Question

I am just wondering if there is a list of attributes name to be referred when using the following:

However, you can set a DOS attribute using the setAttribute(Path, String, Object, LinkOption...) method, as follows:

Path file = ...; Files.setAttribute(file, "dos:hidden", true);

In this case the .isHidden() method is referred as hidden, what about isReadOnly()? I have tried dos:readOnly and other combination, however without achieving the result wanted. Dou you know any link which has a list of those attribute "reference"? Thanks in advance.

Was it helpful?

Solution

http://www.kodejava.org/how-do-i-set-the-value-of-file-attributes/

//
// Set a new file attributes.
//
Files.setAttribute(file, "dos:archive", false);
Files.setAttribute(file, "dos:hidden", false);
Files.setAttribute(file, "dos:readonly", false);
Files.setAttribute(file, "dos:system", false);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top