Possible Duplicate:
How do i programmatically change file permissions?
I want to set read permission for some directory. Because i want to use list() method from java.io.File, but when i print for example this:
System.out.println(fileDir.list());
i get “null”, according to the documentation it may mean that I do not have permissions to the directory, where the file is located.
You could use JNA to call a native C library (as an alternative to using JNI).
The only problem with JNA is that it has a higher process time than JNA, so it becomes impractical if you try to modify a large number of files/directories.
Edit for code
Source