本文整理了Java中java.net.HttpURLConnection.getHeaderFieldDate()
方法的一些代码示例,展示了HttpURLConnection.getHeaderFieldDate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpURLConnection.getHeaderFieldDate()
方法的具体详情如下:
包路径:java.net.HttpURLConnection
类名称:HttpURLConnection
方法名:getHeaderFieldDate
[英]Returns the date value in milliseconds since 01.01.1970, 00:00hcorresponding to the header field field. The defaultValuewill be returned if no such field can be found in the response header.
[中]返回自1970年1月1日00:00h起与标题字段相对应的日期值(以毫秒为单位)。如果在响应标头中找不到此类字段,则将返回DefaultValues。
代码示例来源:origin: square/okhttp
@Override public long getHeaderFieldDate(String field, long defaultValue) {
return delegate.getHeaderFieldDate(field, defaultValue);
}
代码示例来源:origin: prestodb/presto
@Override public long getHeaderFieldDate(String field, long defaultValue) {
return delegate.getHeaderFieldDate(field, defaultValue);
}
代码示例来源:origin: wildfly/wildfly
private static long getRetryAfter(HttpURLConnection connection, boolean useDefaultIfHeaderNotPresent) throws AcmeException {
long retryAfterMilli = -1;
String retryAfter = connection.getHeaderField(RETRY_AFTER);
if (retryAfter != null) {
try {
retryAfterMilli = Integer.parseInt(retryAfter) * 1000;
} catch (NumberFormatException e) {
long retryAfterDate = connection.getHeaderFieldDate(RETRY_AFTER, 0L);
if (retryAfterDate != 0) {
retryAfterMilli = retryAfterDate - Instant.now().toEpochMilli();
}
}
}
if (retryAfterMilli == -1) {
if (useDefaultIfHeaderNotPresent) {
retryAfterMilli = DEFAULT_RETRY_AFTER_MILLI;
}
}
return retryAfterMilli;
}
代码示例来源:origin: EvoSuite/evosuite
@Override
public long getHeaderFieldDate(String name, long Default) {
return super.getHeaderFieldDate(name,Default);
}
代码示例来源:origin: apiman/apiman
@Override public long getHeaderFieldDate(String field, long defaultValue) {
return delegate.getHeaderFieldDate(field, defaultValue);
}
代码示例来源:origin: com.squareup.okhttp/okhttp-urlconnection
@Override public long getHeaderFieldDate(String field, long defaultValue) {
return delegate.getHeaderFieldDate(field, defaultValue);
}
代码示例来源:origin: com.squareup.okhttp3/okhttp-urlconnection
@Override public long getHeaderFieldDate(String field, long defaultValue) {
return delegate.getHeaderFieldDate(field, defaultValue);
}
代码示例来源:origin: kohsuke/jcifs
public long getHeaderFieldDate(String header, long def) {
try {
handshake();
} catch (IOException ex) { }
return connection.getHeaderFieldDate(header, def);
}
代码示例来源:origin: AgNO3/jcifs-ng
@Override
public long getHeaderFieldDate ( String header, long def ) {
handshake();
return this.connection.getHeaderFieldDate(header, def);
}
代码示例来源:origin: jcifs/jcifs
public long getHeaderFieldDate(String header, long def) {
try {
handshake();
} catch (IOException ex) { }
return connection.getHeaderFieldDate(header, def);
}
代码示例来源:origin: com.github.mcpat.gcf/gcf-standard
public final long getHeaderFieldDate(String name, long def) throws IOException {
ensureOpen();
return connection.getHeaderFieldDate(name, def);
}
代码示例来源:origin: com.google.gdata/gdata-java-client
public DateTime getResponseDateHeader(String headerName) {
long dateValue = httpConn.getHeaderFieldDate(headerName, -1);
return (dateValue >= 0) ? new DateTime(dateValue) : null;
}
代码示例来源:origin: org.samba.jcifs/jcifs
public long getHeaderFieldDate(String header, long def) {
try {
handshake();
} catch (IOException ex) { }
return connection.getHeaderFieldDate(header, def);
}
代码示例来源:origin: org.codelibs/jcifs
@Override
public long getHeaderFieldDate ( String header, long def ) {
handshake();
return this.connection.getHeaderFieldDate(header, def);
}
代码示例来源:origin: com.jaeksoft/jcifs-krb5-jdk7
public long getHeaderFieldDate(String header, long def) {
try {
handshake();
} catch (IOException ex) { }
return connection.getHeaderFieldDate(header, def);
}
代码示例来源:origin: com.google.gdata/gdata-core-1.0
public DateTime getResponseDateHeader(String headerName) {
long dateValue = httpConn.getHeaderFieldDate(headerName, -1);
return (dateValue >= 0) ? new DateTime(dateValue) : null;
}
代码示例来源:origin: com.mulesoft.google/google-api-gdata
public DateTime getResponseDateHeader(String headerName) {
long dateValue = httpConn.getHeaderFieldDate(headerName, -1);
return (dateValue >= 0) ? new DateTime(dateValue) : null;
}
代码示例来源:origin: com.bladejava/blade-kit
/**
* Get a date header from the response falling back to returning the given
* default value if the header is missing or parsing fails
*
* @param name
* @param defaultValue
* @return date, default value on failures
* @throws HttpRequestException
*/
public long dateHeader(final String name, final long defaultValue) throws HttpRequestException {
closeOutputQuietly();
return getConnection().getHeaderFieldDate(name, defaultValue);
}
代码示例来源:origin: biezhi/oh-my-request
/**
* Get a date header from the response falling back to returning the given
* default value if the header is missing or parsing fails
*
* @param name
* @param defaultValue
* @return date, default value on failures
* @throws RequestException
*/
public long dateHeader(final String name, final long defaultValue) throws RequestException {
closeOutputQuietly();
return getConnection().getHeaderFieldDate(name, defaultValue);
}
代码示例来源:origin: com.github.kevinsawicki/http-request
/**
* Get a date header from the response falling back to returning the given
* default value if the header is missing or parsing fails
*
* @param name
* @param defaultValue
* @return date, default value on failures
* @throws HttpRequestException
*/
public long dateHeader(final String name, final long defaultValue)
throws HttpRequestException {
closeOutputQuietly();
return getConnection().getHeaderFieldDate(name, defaultValue);
}
内容来源于网络,如有侵权,请联系作者删除!