URLConnection getIfModifiedSince Example
URLConnection class getIfModifiedSince example. This example shows you how to use getIfModifiedSince method.
URLConnection class getIfModifiedSince example. public long getIfModifiedSince() Returns the value of this object's ifModifiedSince field.
Here is the code
/*
* @ # GetHeaderFields.java
* A class repersenting use to GetHeaderFields
* method of URLConnection class in java.net package
* version 23 June 2008
* author Rose India
*/
import java.net.*;
public class GetIfModifiedSince {
public static void main(String args[]) throws Exception {
SocketAddress socketAddress =
new InetSocketAddress("192.168.10.80", 9090);
Proxy proxy = new Proxy(Proxy.Type.HTTP, socketAddress);
URL url = new URL("http://google.com");
URLConnection connection = url.openConnection(proxy);
System.out.println("ifModifiedSince field " +
connection.getIfModifiedSince());
}
} |
|