Are there any ways of setting file permissions using java8 NIO2 on Windows different from this?
file.setReadable(false, false);
file.setExecutable(false, false);
file.setWritable(false, false);
Are there any ways of setting file permissions using java8 NIO2 on Windows different from this?
file.setReadable(false, false);
file.setExecutable(false, false);
file.setWritable(false, false);
Copyright © 2021 Jogjafile Inc.
The
Filemethods that set various attributes:setExecutable,setReadable,setReadOnly,setWritableare replaced by theFilesmethod setAttribute(Path, String, Object, LinkOption...).Usage Example:
See AclFileAttributeView for more details.