Tabnine Logo
NameValuePair.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
org.apache.commons.httpclient.NameValuePair

Best Java code snippets using org.apache.commons.httpclient.NameValuePair.getValue (Showing top 20 results out of 315)

origin: commons-httpclient/commons-httpclient

/**
 * Return a name/value string suitable for sending in a <tt>"Cookie"</tt>
 * header as defined in RFC 2109 for backward compatibility with cookie
 * version 0
 * @param buffer The string buffer to use for output
 * @param param The parameter.
 * @param version The cookie version 
 */
private void formatParam(final StringBuffer buffer, final NameValuePair param, int version) {
  if (version < 1) {
    buffer.append(param.getName());
    buffer.append("=");
    if (param.getValue() != null) {
      buffer.append(param.getValue());   
    }
  } else {
    this.formatter.format(buffer, param);
  }
}
origin: commons-httpclient/commons-httpclient

&& paramValue.equals(pair.getValue())) {
iter.remove();
return true;
origin: commons-httpclient/commons-httpclient

/**
 * Produces textual representaion of the attribute/value pair using 
 * formatting rules defined in RFC 2616
 *  
 * @param buffer output buffer 
 * @param param the parameter to be formatted
 */
public void format(final StringBuffer buffer, final NameValuePair param) {
  if (buffer == null) {
    throw new IllegalArgumentException("String buffer may not be null");
  }
  if (param == null) {
    throw new IllegalArgumentException("Parameter may not be null");
  }
  buffer.append(param.getName());
  String value = param.getValue();
  if (value != null) {
    buffer.append("=");
    formatValue(buffer, value, this.alwaysUseQuotes);
  }
}

origin: commons-httpclient/commons-httpclient

/**
 * Adds a new parameter to be used in the POST request body.
 *
 * @param param The parameter to add.
 *
 * @throws IllegalArgumentException if the argument is null or contains
 *         null values
 *
 * @since 2.0
 */
public void addParameter(NameValuePair param) 
throws IllegalArgumentException {
  LOG.trace("enter PostMethod.addParameter(NameValuePair)");
  if (param == null) {
    throw new IllegalArgumentException("NameValuePair may not be null");
  }
  addParameter(param.getName(), param.getValue());
}
origin: commons-httpclient/commons-httpclient

/** 
 * Extracts a map of challenge parameters from an authentication challenge.
 * Keys in the map are lower-cased
 *
 * @param challengeStr the authentication challenge string
 * @return a map of authentication challenge parameters
 * @throws MalformedChallengeException when the authentication challenge string
 *  is malformed
 * 
 * @since 2.0beta1
 */
public static Map extractParams(final String challengeStr)
 throws MalformedChallengeException {
  if (challengeStr == null) {
    throw new IllegalArgumentException("Challenge may not be null"); 
  }
  int idx = challengeStr.indexOf(' ');
  if (idx == -1) {
    throw new MalformedChallengeException("Invalid challenge: " + challengeStr);
  }
  Map map = new HashMap();
  ParameterParser parser = new ParameterParser();
  List params = parser.parse(
    challengeStr.substring(idx + 1, challengeStr.length()), ',');
  for (int i = 0; i < params.size(); i++) {
    NameValuePair param = (NameValuePair) params.get(i);
    map.put(param.getName().toLowerCase(), param.getValue());
  }
  return map;
}
origin: commons-httpclient/commons-httpclient

  this.charset = charsetPair.getValue();
} else if (charset != null && charsetPair == null) {
origin: commons-httpclient/commons-httpclient

if (pair.getValue() != null) {
  buf.append(codec.encode(pair.getValue(), charset));
origin: commons-httpclient/commons-httpclient

/**
 * Constructor with array of characters.
 *
 * @param chars the array of characters
 * @param offset - the initial offset.
 * @param length - the length.
 * 
 * @since 3.0
 */
public HeaderElement(char[] chars, int offset, int length) {
  this();
  if (chars == null) {
    return;
  }
  ParameterParser parser = new ParameterParser();
  List params = parser.parse(chars, offset, length, ';');
  if (params.size() > 0) {
    NameValuePair element = (NameValuePair) params.remove(0);
    setName(element.getName());  
    setValue(element.getValue());
    if (params.size() > 0) {
      this.parameters = (NameValuePair[])
        params.toArray(new NameValuePair[params.size()]);    
    }
  }
}
origin: commons-httpclient/commons-httpclient

final String paramValue = attribute.getValue();
origin: commons-httpclient/commons-httpclient

final String paramValue = attribute.getValue();
origin: commons-httpclient/commons-httpclient

/**
 * Returns the character set from the <tt>Content-Type</tt> header.
 * 
 * @param contentheader The content header.
 * @return String The character set.
 */
protected String getContentCharSet(Header contentheader) {
  LOG.trace("enter getContentCharSet( Header contentheader )");
  String charset = null;
  if (contentheader != null) {
    HeaderElement values[] = contentheader.getElements();
    // I expect only one header element to be there
    // No more. no less
    if (values.length == 1) {
      NameValuePair param = values[0].getParameterByName("charset");
      if (param != null) {
        // If I get anything "funny" 
        // UnsupportedEncondingException will result
        charset = param.getValue();
      }
    }
  }
  if (charset == null) {
    charset = getParams().getContentCharset();
    if (LOG.isDebugEnabled()) {
      LOG.debug("Default charset used: " + charset);
    }
  }
  return charset;
}
origin: commons-httpclient/commons-httpclient

final String paramValue = attribute.getValue();
origin: commons-httpclient/commons-httpclient

String paramValue = attribute.getValue();
origin: apache/cloudstack

/**
 * Builds parameters string with command and encoded param values
 * @param command
 * @param params
 * @return
 */
protected static String buildParams(String command, List<NameValuePair> params) {
  StringBuffer paramString = new StringBuffer("command=" + command);
  Iterator<NameValuePair> iter = params.iterator();
  try {
    while (iter.hasNext()) {
      NameValuePair param = iter.next();
      if (param.getValue() != null && !(param.getValue().isEmpty())) {
        paramString.append("&" + param.getName() + "=" + URLEncoder.encode(param.getValue(), "UTF-8"));
      }
    }
  } catch (UnsupportedEncodingException e) {
    s_logger.error(e.getMessage());
    return null;
  }
  return paramString.toString();
}
origin: org.codehaus.xfire/xfire-core

/**
 * @return
 */

public boolean hasResponse()
{
  NameValuePair pair = postMethod.getResponseHeader("Content-Type");
  if(pair == null) return false;
  
  String ct = pair.getValue();
  
  return ct != null && ct.length() > 0;
}
 
origin: info.kwarc.sally4/sally4-servlet

  @Override
  public void process(Exchange exchange) throws Exception {
    HashMap<String, String> result = new HashMap<String, String>();
    for (NameValuePair pairs  : (List<NameValuePair>) parser.parse(exchange.getIn().getHeader(Exchange.HTTP_QUERY, String.class), '&')) {
      result.put(pairs.getName(), pairs.getValue());
    }
    exchange.getIn().setHeader(QueryMapHeader, result);
  }
}
origin: org.jenkins-ci/htmlunit

/**
 * {@inheritDoc}
 */
public String getResponseHeaderValue(final String headerName) {
  for (final NameValuePair pair : responseData_.getResponseHeaders()) {
    if (pair.getName().equalsIgnoreCase(headerName)) {
      return pair.getValue();
    }
  }
  return null;
}
origin: net.disy.htmlunit/htmlunit

/**
 * {@inheritDoc}
 */
public String getResponseHeaderValue(final String headerName) {
  for (final NameValuePair pair : responseData_.getResponseHeaders()) {
    if (pair.getName().equalsIgnoreCase(headerName)) {
      return pair.getValue();
    }
  }
  return null;
}
origin: xmlrpc/xmlrpc-client

protected boolean isResponseGzipCompressed() {
  Header h = method.getResponseHeader( "Content-Encoding" );
  if (h == null) {
    return false;
  } else {
    return HttpUtil.isUsingGzipEncoding(h.getValue());
  }
}
origin: org.apache.axis2/axis2-transport-http

private String processCookieHeader(HeaderElement element) {
  String cookie = element.getName() + "=" + element.getValue();
  NameValuePair[] parameters = element.getParameters();
  for (int j = 0; parameters != null && j < parameters.length; j++) {
    NameValuePair parameter = parameters[j];
    cookie = cookie + "; " + parameter.getName() + "=" + parameter.getValue();
  }
  return cookie;
}
org.apache.commons.httpclientNameValuePairgetValue

Javadoc

Return the current value.

Popular methods of NameValuePair

  • <init>
    Constructor.
  • getName
    Return the name.
  • setName
    Set the name.
  • setValue
    Set the value.
  • toString
    Get a String representation of this pair.

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Path (java.nio.file)
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JPanel (javax.swing)
  • JTable (javax.swing)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now