views:

1072

answers:

1

To my knowledge, Java's File class does not support to change the file's permission and last modified date. Is there any proper way to do this in a cross-platform style?

+6  A: 

I'm looking at the Java 6 documentation, and there is a setLastModified() method, as well as setReadable(...) and setWritable(...) and setExecutable(...) methods (all in the java.io.File class). So yes, there is a way...

David Zaslavsky
Other than setLastModified and setReadOnly, which were in Java 1.2, the others were added in 1.6
Stephen Denne