URLConnection getLastModified Example
URLConnection class getLastModified example. This example shows you how to use getLastModified method.
URLConnection class getLastModified example. public long getLastModified() Returns the value of the last-modified header field. The result is the number of milliseconds since January 1, 1970 GMT.
Here is the code
/*
* @ # GetLastModified.java
* A class repersenting use to GetLastModified method
* of URL class in java.net package
* version 24 June 2008
* author Rose India
*/
import java.net.*;
public class GetLastModified {
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("LastModified "+connection.getLastModified());
}
} |
|