java.net.HttpURLConnection.getHeaderFieldInt()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(147)

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

HttpURLConnection.getHeaderFieldInt介绍

暂无

代码示例

代码示例来源:origin: square/okhttp

@Override public int getHeaderFieldInt(String field, int defaultValue) {
 return delegate.getHeaderFieldInt(field, defaultValue);
}

代码示例来源:origin: prestodb/presto

@Override public int getHeaderFieldInt(String field, int defaultValue) {
 return delegate.getHeaderFieldInt(field, defaultValue);
}

代码示例来源:origin: Azure/azure-storage-android

/**
 * Parses out the share quota value from a <code>java.net.HttpURLConnection</code>.
 *
 * @param request
 *            the request to get attributes from
 * @return the share quota (in GB) or <code>null</code> if none is specified
 */
static Integer parseShareQuota(final HttpURLConnection request) {
  Integer shareQuota = request.getHeaderFieldInt(FileConstants.SHARE_QUOTA_HEADER, -1);
  return (shareQuota == -1) ? null : shareQuota;
}

代码示例来源:origin: com.microsoft.azure/azure-storage

/**
 * Parses out the share quota value from a <code>java.net.HttpURLConnection</code>.
 *
 * @param request
 *            the request to get attributes from
 * @return the share quota (in GB) or <code>null</code> if none is specified
 */
static Integer parseShareQuota(final HttpURLConnection request) {
  Integer shareQuota = request.getHeaderFieldInt(FileConstants.SHARE_QUOTA_HEADER, -1);
  return (shareQuota == -1) ? null : shareQuota;
}

代码示例来源:origin: apiman/apiman

@Override public int getHeaderFieldInt(String field, int defaultValue) {
 return delegate.getHeaderFieldInt(field, defaultValue);
}

代码示例来源:origin: EvoSuite/evosuite

@Override
public int getHeaderFieldInt(String name, int Default) {
  return super.getHeaderFieldInt(name,Default);
}

代码示例来源:origin: hgoebl/DavidWebb

/**
 * Returns the value of the named field parsed as a number.
 * <br>
 * See <a href="http://docs.oracle.com/javase/7/docs/api/java/net/URLConnection.html#getHeaderFieldInt(java.lang.String,+int)">
 *     URLConnection.getHeaderFieldInt()</a>
 *
 * @param field name of the header field
 * @param defaultValue the default value if the field is not present or malformed
 * @return the value of the named header field, or the given default value
 */
public int getHeaderFieldInt(String field, int defaultValue) {
  return connection.getHeaderFieldInt(field, defaultValue);
}

代码示例来源:origin: Coolerfall/Android-HttpDownloadManager

int getContentLength(HttpURLConnection conn) {
  String transferEncoding = conn.getHeaderField(TRANSFER_ENCODING);
  if (transferEncoding == null || transferEncoding.equalsIgnoreCase("chunked")) {
   return conn.getHeaderFieldInt(CONTENT_LENGTH, -1);
  } else {
   return -1;
  }
 }
}

代码示例来源:origin: org.codelibs/jcifs

@Override
public int getHeaderFieldInt ( String header, int def ) {
  handshake();
  return this.connection.getHeaderFieldInt(header, def);
}

代码示例来源:origin: kohsuke/jcifs

public int getHeaderFieldInt(String header, int def) {
  try {
    handshake();
  } catch (IOException ex) { }
  return connection.getHeaderFieldInt(header, def);
}

代码示例来源:origin: jcifs/jcifs

public int getHeaderFieldInt(String header, int def) {
  try {
    handshake();
  } catch (IOException ex) { }
  return connection.getHeaderFieldInt(header, def);
}

代码示例来源:origin: AgNO3/jcifs-ng

@Override
public int getHeaderFieldInt ( String header, int def ) {
  handshake();
  return this.connection.getHeaderFieldInt(header, def);
}

代码示例来源:origin: com.jaeksoft/jcifs-krb5-jdk7

public int getHeaderFieldInt(String header, int def) {
  try {
    handshake();
  } catch (IOException ex) { }
  return connection.getHeaderFieldInt(header, def);
}

代码示例来源:origin: com.github.mcpat.gcf/gcf-standard

public final int getHeaderFieldInt(String name, int def) throws IOException {
  ensureOpen();
  return connection.getHeaderFieldInt(name, def);
}

代码示例来源:origin: org.kie.remote/kie-remote-common

private int intResponseHeader( final String name ) throws KieRemoteHttpRequestException {
  closeOutputQuietly();
  return getConnection().getHeaderFieldInt(name, -1);
}

代码示例来源:origin: kiegroup/droolsjbpm-integration

private int responseContentLength() {
  closeOutputQuietly();
  return getConnection().getHeaderFieldInt(CONTENT_LENGTH, -1);
}

代码示例来源:origin: org.kie.server/kie-server-common

private int intResponseHeader( final String name ) throws KieServerHttpRequestException {
  closeOutputQuietly();
  return getConnection().getHeaderFieldInt(name, -1);
}

代码示例来源:origin: org.kie.server/kie-server-common

private int responseContentLength() {
  closeOutputQuietly();
  return getConnection().getHeaderFieldInt(CONTENT_LENGTH, -1);
}

代码示例来源:origin: kiegroup/droolsjbpm-integration

private int intResponseHeader( final String name ) throws KieServerHttpRequestException {
  closeOutputQuietly();
  return getConnection().getHeaderFieldInt(name, -1);
}

代码示例来源:origin: org.kie.remote/kie-remote-common

private int responseContentLength() {
  closeOutputQuietly();
  return getConnection().getHeaderFieldInt(CONTENT_LENGTH, -1);
}

相关文章

HttpURLConnection类方法