I have a piece of code using which I create a new directory. I want to do a chmod -R 755 ./destDirectory
Way I am creating files is:
File destFile = new File("/home/destFile"); File oneFile = new File("home/destFile/1");
I have a piece of code using which I create a new directory. I want to do a chmod -R 755 ./destDirectory
Way I am creating files is:
File destFile = new File("/home/destFile"); File oneFile = new File("home/destFile/1");
Check out the API documentation for the java.no.file.Files
class, which has a variety of utility methods for setting attributes, permissions, and performing other actions not found in the java.io.File class.
You can use the createDirectory(...)
method to set permissions upon creation, or the setPosixFilePermissions(...)
method for an existing file or directory.