2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

how to set file permission based on the requirement using java code?

i have requirement like to create dynamic files where i need to set the permissions to the files that i have created. How to set permission when i am creating the file?
userimage

To give permission to a file at run-time you can use below methods of File api:

filePermission.setExecutable(false);
filePermission.setReadable(false);
filePermission.setWritable(false);


Hope this will work for you.

Answer is