programming-examples/java/Numerical_Problems/java program to check a file is modified at a server or not.java
2019-11-15 12:59:38 +01:00

12 lines
434 B
Java

import java.net.URL;
import java.net.URLConnection;
public class Main {
public static void main(String[] argv)
throws Exception {
URL u = new URL("http://127.0.0.1/java.bmp");
URLConnection uc = u.openConnection();
uc.setUseCaches(false);
long timestamp = uc.getLastModified();
System.out.println("The last modification time of java.bmp is :"+timestamp);
}
}