コード例 #1
0
  /**
   * This is used to remove the named header from the response. This removes all header values
   * assigned to the specified name. If it does not exist then this will return without modifying
   * the HTTP response. Headers names removed are case insensitive.
   *
   * @param name the HTTP message header to remove from the response
   */
  public void remove(String name) {
    String token = name.toLowerCase();
    String value = names.get(token);

    if (value != null) {
      names.remove(token);
    }
    values.remove(token);
  }
コード例 #2
0
  /**
   * This is used to acquire all the individual header values from the message. The header values
   * provided by this are unparsed and represent the actual string values that have been added to
   * the message keyed by a given header name.
   *
   * @param name the name of the header to get the values for
   * @return this returns a list of the values for the header name
   */
  public List<String> getAll(String name) {
    String token = name.toLowerCase();
    Series series = values.get(token);

    if (series == null) {
      return getAll(name, token);
    }
    return series.getValues();
  }
コード例 #3
0
  /**
   * This is used to acquire all the individual header values from the message. The header values
   * provided by this are unparsed and represent the actual string values that have been added to
   * the message keyed by a given header name.
   *
   * @param name the name of the header to get the values for
   * @param token this provides a lower case version of the header
   * @return this returns a list of the values for the header name
   */
  private List<String> getAll(String name, String token) {
    Series series = new Series();
    String value = names.get(token);

    if (value == null) {
      names.put(token, name);
    }
    values.put(token, series);

    return series.getValues();
  }
コード例 #4
0
 /**
  * This returns the <code>Cookie</code> object stored under the specified name. This is used to
  * retrieve cookies that have been set with the <code>setCookie</code> methods. If the cookie does
  * not exist under the specified name this will return null.
  *
  * @param name this is the name of the cookie to be retrieved
  * @return returns the <code>Cookie</code> by the given name
  */
 public Cookie getCookie(String name) {
   return cookies.get(name);
 }