java.net.URLConnection.getHeaderFieldDate()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(182)

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

URLConnection.getHeaderFieldDate介绍

[英]Returns the specified header value as a date in milliseconds since January 1, 1970 GMT. Returns the defaultValue if no such header field could be found.
[中]从1970年1月1日GMT开始以毫秒为单位返回指定的标头值。如果找不到此类标头字段,则返回defaultValue。

代码示例

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

/**
 * Returns the timestamp when this response will be expired in milliseconds
 * since January 1, 1970 GMT or {@code 0} if this timestamp is unknown.
 *
 * @return the value of the response header field {@code expires}.
 */
public long getExpiration() {
  return getHeaderFieldDate("Expires", 0);
}

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

/**
 * Returns the timestamp when this response has been sent as a date in
 * milliseconds since January 1, 1970 GMT or {@code 0} if this timestamp is
 * unknown.
 *
 * @return the sending timestamp of the current response.
 */
public long getDate() {
  return getHeaderFieldDate("Date", 0);
}

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

/**
 * Returns the value of the response header field {@code last-modified} or
 * {@code 0} if this value is not set.
 *
 * @return the value of the {@code last-modified} header field.
 */
public long getLastModified() {
  if (lastModified != -1) {
    return lastModified;
  }
  return lastModified = getHeaderFieldDate("Last-Modified", 0);
}

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

/**
 * Returns the date value in milliseconds since {@code 01.01.1970, 00:00h}
 * corresponding to the header field {@code field}. The {@code defaultValue}
 * will be returned if no such field can be found in the response header.
 *
 * @param field
 *            the header field name.
 * @param defaultValue
 *            the default value to use if the specified header field wont be
 *            found.
 * @return the header field represented in milliseconds since January 1,
 *         1970 GMT.
 */
@Override
public long getHeaderFieldDate(String field, long defaultValue) {
  return super.getHeaderFieldDate(field, defaultValue);
}

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

public @Override long getHeaderFieldDate(String name, long Default) {
  if (name.equalsIgnoreCase("last-modified")) { // NOI18N
    try {
      connect();
      return fo.lastModified().getTime();
    } catch (IOException e) {
    }
  }
  return super.getHeaderFieldDate(name, Default);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the timestamp when this response will be expired in milliseconds
 * since January 1, 1970 GMT or {@code 0} if this timestamp is unknown.
 *
 * @return the value of the response header field {@code expires}.
 */
public long getExpiration() {
  return getHeaderFieldDate("Expires", 0);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the timestamp when this response will be expired in milliseconds
 * since January 1, 1970 GMT or {@code 0} if this timestamp is unknown.
 *
 * @return the value of the response header field {@code expires}.
 */
public long getExpiration() {
  return getHeaderFieldDate("Expires", 0);
}

代码示例来源:origin: com.jtransc/jtransc-rt

/**
 * Returns the timestamp when this response has been sent as a date in
 * milliseconds since January 1, 1970 GMT or {@code 0} if this timestamp is
 * unknown.
 *
 * @return the sending timestamp of the current response.
 */
public long getDate() {
  return getHeaderFieldDate("Date", 0);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns the value of the response header field {@code last-modified} or
 * {@code 0} if this value is not set.
 *
 * @return the value of the {@code last-modified} header field.
 */
public long getLastModified() {
  if (lastModified != -1) {
    return lastModified;
  }
  return lastModified = getHeaderFieldDate("Last-Modified", 0);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the timestamp when this response has been sent as a date in
 * milliseconds since January 1, 1970 GMT or {@code 0} if this timestamp is
 * unknown.
 *
 * @return the sending timestamp of the current response.
 */
public long getDate() {
  return getHeaderFieldDate("Date", 0);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the value of the response header field {@code last-modified} or
 * {@code 0} if this value is not set.
 *
 * @return the value of the {@code last-modified} header field.
 */
public long getLastModified() {
  if (lastModified != -1) {
    return lastModified;
  }
  return lastModified = getHeaderFieldDate("Last-Modified", 0);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the timestamp when this response has been sent as a date in
 * milliseconds since January 1, 1970 GMT or {@code 0} if this timestamp is
 * unknown.
 *
 * @return the sending timestamp of the current response.
 */
public long getDate() {
  return getHeaderFieldDate("Date", 0);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the value of the response header field {@code last-modified} or
 * {@code 0} if this value is not set.
 *
 * @return the value of the {@code last-modified} header field.
 */
public long getLastModified() {
  if (lastModified != -1) {
    return lastModified;
  }
  return lastModified = getHeaderFieldDate("Last-Modified", 0);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns the timestamp when this response will be expired in milliseconds
 * since January 1, 1970 GMT or {@code 0} if this timestamp is unknown.
 *
 * @return the value of the response header field {@code expires}.
 */
public long getExpiration() {
  return getHeaderFieldDate("Expires", 0);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns the value of the response header field {@code last-modified} or
 * {@code 0} if this value is not set.
 *
 * @return the value of the {@code last-modified} header field.
 */
public long getLastModified() {
  if (lastModified != -1) {
    return lastModified;
  }
  return lastModified = getHeaderFieldDate("Last-Modified", 0);
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * Returns the value of the <code>expires</code> header field.
 *
 * @return  the expiration date of the resource that this URL references,
 *          or 0 if not known. The value is the number of milliseconds since
 *          January 1, 1970 GMT.
 * @see     java.net.URLConnection#getHeaderField(java.lang.String)
 */
public long getExpiration() {
  return getHeaderFieldDate("expires", 0);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns the timestamp when this response has been sent as a date in
 * milliseconds since January 1, 1970 GMT or {@code 0} if this timestamp is
 * unknown.
 *
 * @return the sending timestamp of the current response.
 */
public long getDate() {
  return getHeaderFieldDate("Date", 0);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns the timestamp when this response will be expired in milliseconds
 * since January 1, 1970 GMT or {@code 0} if this timestamp is unknown.
 *
 * @return the value of the response header field {@code expires}.
 */
public long getExpiration() {
  return getHeaderFieldDate("Expires", 0);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-debugger-jpda-js

public @Override long getHeaderFieldDate(String name, long Default) {
  if (name.equalsIgnoreCase("last-modified")) { // NOI18N
    try {
      connect();
      return fo.lastModified().getTime();
    } catch (IOException e) {
    }
  }
  return super.getHeaderFieldDate(name, Default);
}

代码示例来源:origin: octo-online/reactive-audit

@Test(expected = NetworkReactiveAuditException.class)
public void getHeaderFieldDate()
    throws IOException
{
  Assume.assumeTrue(IOTestTools.isNetworkConnected());
  ReactiveAudit.off.commit();
  URLConnection conn = new URL("http://" + HOST + ":" + PORT).openConnection();
  TestTools.strict.commit();
  conn.getHeaderFieldDate("expiration", 0);
}

相关文章

URLConnection类方法