3

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.

Rollerball
  • 12,618
  • 23
  • 92
  • 161

1 Answers1

3

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);
Tricky12
  • 6,752
  • 1
  • 27
  • 35
  • 1
    forget about it: "This attribute is often used to indicate that the file is a component of the operating system." – Rollerball Aug 07 '13 at 20:01
  • I was just about to reply, and that's about exactly what I was going to say. Honestly, I don't really know when anyone would need that command. – Tricky12 Aug 07 '13 at 20:10