File file = new File("filename");

// Get the last modified time
long modifiedTime = file.lastified();
// 0L is returned if the file does not exist

// Set the last modified time
long newifiedTime = System.currentTimeMillis();
boolean success = file.setLastified(newifiedTime);
if (!success) {
    // operation failed.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.