org.glassfish.grizzly.http.util.Header.toString()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中org.glassfish.grizzly.http.util.Header.toString()方法的一些代码示例,展示了Header.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Header.toString()方法的具体详情如下:
包路径:org.glassfish.grizzly.http.util.Header
类名称:Header
方法名:toString

Header.toString介绍

[英]Returns the name of the header properly hyphenated if necessary.
[中]如果需要,返回正确连字符的标题名称。

代码示例

代码示例来源:origin: com.ning/async-http-client

private static String authorizationHeaderName(final boolean proxyInd) {
  return proxyInd
      ? Header.ProxyAuthorization.toString()
      : Header.Authorization.toString();
}

代码示例来源:origin: com.ning/async-http-client

private static Request newRequest(final HttpTransactionContext ctx,
    final Uri newUri, final HttpResponsePacket response,
    final Realm realm, boolean asGet) {
  final Request prototype = ctx.getAhcRequest();
  final FluentCaseInsensitiveStringsMap prototypeHeaders =
      prototype.getHeaders();
  
  prototypeHeaders.remove(Header.Host.toString());
  prototypeHeaders.remove(Header.ContentLength.toString());
  
  if (asGet)
    prototypeHeaders.remove(Header.ContentType.toString());
  if (realm != null && realm.getScheme() == AuthScheme.NTLM) {
    prototypeHeaders.remove(Header.Authorization.toString());
    prototypeHeaders.remove(Header.ProxyAuthorization.toString());
  }
  
  final RequestBuilder builder = new RequestBuilder(prototype);
  if (asGet) {
    builder.setMethod("GET");
  }
  builder.setUrl(newUri.toString());
  for (String cookieStr : response.getHeaders().values(Header.SetCookie)) {
    builder.addOrReplaceCookie(CookieDecoder.decode(cookieStr));
  }
      
  return builder.build();
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client

private static String authorizationHeaderName(final boolean proxyInd) {
  return proxyInd
      ? Header.ProxyAuthorization.toString()
      : Header.Authorization.toString();
}

代码示例来源:origin: com.ning/async-http-client

private static Realm ntlmProxyChallenge(final Connection c,
    final String wwwAuth, final Request request,
    final ProxyServer proxyServer)
    throws NTLMEngineException {
  
  final FluentCaseInsensitiveStringsMap headers = request.getHeaders();
  headers.remove(Header.ProxyAuthorization.toString());
  Realm realm = proxyServer.realmBuilder()//
      .setScheme(AuthScheme.NTLM)//
      .setUri(request.getUri())//
      .setMethodName(request.getMethod()).build();
  
  addType3NTLMAuthorizationHeader(wwwAuth, headers, realm, true);
  // we mark NTLM as established for the Connection to
  // avoid preemptive NTLM
  Utils.setNtlmEstablished(c);
  return realm;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 *
 * @param header
 * @param value
 *
 * @since 2.1.2
 */
void setHeader(final Header header, final String value) {
  headers.put(header.toString(), value);
}

代码示例来源:origin: javaee/grizzly

/**
 * Get the multipart entry header value.
 *
 * @param header entry header.
 * @return the multipart entry header value.
 *
 * @since 2.1.2
 */
public String getHeader(final Header header) {
  return headers.get(header.toString());
}

代码示例来源:origin: javaee/grizzly

/**
 * Get the multipart entry header value.
 *
 * @param header entry header.
 * @return the multipart entry header value.
 *
 * @since 2.1.2
 */
public String getHeader(final Header header) {
  return headers.get(header.toString());
}

代码示例来源:origin: javaee/grizzly

/**
 *
 * @param header
 * @param value
 *
 * @since 2.1.2
 */
void setHeader(final Header header, final String value) {
  headers.put(header.toString(), value);
}

代码示例来源:origin: javaee/grizzly

/**
 *
 * @param header
 * @param value
 *
 * @since 2.1.2
 */
void setHeader(final Header header, final String value) {
  headers.put(header.toString(), value);
}

代码示例来源:origin: javaee/grizzly

/**
 *
 * @param header
 * @param value
 *
 * @since 2.1.2
 */
void setHeader(final Header header, final String value) {
  headers.put(header.toString(), value);
}

代码示例来源:origin: javaee/grizzly

/**
 * Get the multipart entry header value.
 *
 * @param header entry header.
 * @return the multipart entry header value.
 *
 * @since 2.1.2
 */
public String getHeader(final Header header) {
  return headers.get(header.toString());
}

代码示例来源:origin: javaee/grizzly

/**
 *
 * @param header
 * @param value
 *
 * @since 2.1.2
 */
void setHeader(final Header header, final String value) {
  headers.put(header.toString(), value);
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http

private void handleSpecialHeaderRemove(final String name) {
  final char c = name.charAt(0);
  boolean isC = (c == 'c' || c == 'C');
  if (isC && Header.ContentLength.toString().equals(name)) {
    contentLength = null;
    return;
  }
  boolean isU = (c == 'u' || c == 'U');
  if (isU && Header.Upgrade.toString().equals(name)) {
    upgrade = null;
  }
}

代码示例来源:origin: javaee/grizzly

private void handleSpecialHeaderRemove(final String name) {
  final char c = name.charAt(0);
  boolean isC = (c == 'c' || c == 'C');
  if (isC && Header.ContentLength.toString().equals(name)) {
    contentLength = null;
    return;
  }
  boolean isU = (c == 'u' || c == 'U');
  if (isU && Header.Upgrade.toString().equals(name)) {
    upgrade = null;
  }
}

代码示例来源:origin: javaee/grizzly

private void handleSpecialHeaderRemove(final String name) {
  final char c = name.charAt(0);
  boolean isC = (c == 'c' || c == 'C');
  if (isC && Header.ContentLength.toString().equals(name)) {
    contentLength = null;
    return;
  }
  boolean isU = (c == 'u' || c == 'U');
  if (isU && Header.Upgrade.toString().equals(name)) {
    upgrade = null;
  }
}

代码示例来源:origin: javaee/grizzly

private void handleSpecialHeaderRemove(final String name) {
  final char c = name.charAt(0);
  boolean isC = (c == 'c' || c == 'C');
  if (isC && Header.ContentLength.toString().equals(name)) {
    contentLength = null;
    return;
  }
  boolean isU = (c == 'u' || c == 'U');
  if (isU && Header.Upgrade.toString().equals(name)) {
    upgrade = null;
  }
}

代码示例来源:origin: javaee/grizzly

private void handleSpecialHeaderRemove(final String name) {
  final char c = name.charAt(0);
  boolean isC = (c == 'c' || c == 'C');
  if (isC && Header.ContentLength.toString().equals(name)) {
    contentLength = null;
    return;
  }
  boolean isU = (c == 'u' || c == 'U');
  if (isU && Header.Upgrade.toString().equals(name)) {
    upgrade = null;
  }
}

代码示例来源:origin: javaee/grizzly

private void handleSpecialHeaderRemove(final String name) {
  final char c = name.charAt(0);
  boolean isC = (c == 'c' || c == 'C');
  if (isC && Header.ContentLength.toString().equals(name)) {
    contentLength = null;
    return;
  }
  boolean isU = (c == 'u' || c == 'U');
  if (isU && Header.Upgrade.toString().equals(name)) {
    upgrade = null;
  }
}

代码示例来源:origin: javaee/grizzly

private void handleSpecialHeaderRemove(final String name) {
  final char c = name.charAt(0);
  boolean isC = (c == 'c' || c == 'C');
  if (isC && Header.ContentLength.toString().equals(name)) {
    contentLength = null;
    return;
  }
  boolean isU = (c == 'u' || c == 'U');
  if (isU && Header.Upgrade.toString().equals(name)) {
    upgrade = null;
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

private void handleSpecialHeaderRemove(final String name) {
  final char c = name.charAt(0);
  boolean isC = (c == 'c' || c == 'C');
  if (isC && Header.ContentLength.toString().equals(name)) {
    contentLength = null;
    return;
  }
  boolean isU = (c == 'u' || c == 'U');
  if (isU && Header.Upgrade.toString().equals(name)) {
    upgrade = null;
  }
}

相关文章