Java tutorial
import java.io.File; public class Main { public static void main(String[] argv) throws Exception { File file = new File("filename"); long modifiedTime = file.lastModified(); // 0L is returned if the file does not exist long newModifiedTime = System.currentTimeMillis(); boolean success = file.setLastModified(newModifiedTime); if (!success) { // operation failed. } } }