/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
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); }
@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); }