I need to set the permission to read a file to a specific user of the operating system, how can I do this in Java?
Edit:
The file will be created with permissions just to the user running the application, than it needs to set read permission to a single user, other users will not have the permissions to read the file.
if you want to change file permissions on old Java versions like Java 5, you can use this:
on windows you’ll have to replace chmod with the appropriate CACLS.exe command syntax