Java tutorial
import java.io.File; import java.util.Date; public class Main { public static void main(String[] args) { File f = new File("c:/test.txt"); boolean bool = f.exists(); // if path exists if (bool) { // returns the time file was last modified long millisec = f.lastModified(); // date and time Date dt = new Date(millisec); // path String path = f.getPath(); System.out.print(path + " last modified at: " + dt); } } }