コード例 #1
0
 private void doSetHeader(RuntimeDelegate rd, String name, Object value) {
   HeaderDelegate<Object> hd = HttpUtils.getHeaderDelegate(rd, value);
   if (hd != null) {
     value = hd.toString(value);
   }
   webClient.header(name, value);
 }
コード例 #2
0
ファイル: ClientRequest.java プロジェクト: mmatula/jersey-1.x
  /**
   * Convert a header value, represented as a general object, to the string value.
   *
   * <p>This method defers to {@link RuntimeDelegate#createHeaderDelegate} to obtain a {@link
   * HeaderDelegate} to convert the value to a string. If a {@link HeaderDelegate} is not found then
   * the <code>toString</code> is utilized.
   *
   * @param headerValue the header value as an object
   * @return the string value
   */
  public static String getHeaderValue(Object headerValue) {
    HeaderDelegate hp = rd.createHeaderDelegate(headerValue.getClass());

    return (hp != null) ? hp.toString(headerValue) : headerValue.toString();
  }
コード例 #3
0
ファイル: Cookie.java プロジェクト: GurgleSSH/Laundry
 /**
  * Creates a new instance of Cookie by parsing the supplied string.
  *
  * @param value the cookie string
  * @return the newly created Cookie
  * @throws IllegalArgumentException if the supplied string cannot be parsed or is null
  */
 public static Cookie valueOf(String value) throws IllegalArgumentException {
   return delegate.fromString(value);
 }
コード例 #4
0
ファイル: Cookie.java プロジェクト: GurgleSSH/Laundry
 /**
  * Convert the cookie to a string suitable for use as the value of the corresponding HTTP header.
  *
  * @return a stringified cookie
  */
 @Override
 public String toString() {
   return delegate.toString(this);
 }