0

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");

user966123
  • 631
  • 1
  • 9
  • 18

1 Answers1

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.

RichW
  • 2,004
  • 2
  • 15
  • 24