About Question enthuware.ocpjp.v7.2.1523 :
Moderator: admin
-
- Posts: 9
- Joined: Fri Oct 09, 2015 3:52 am
- Contact:
About Question enthuware.ocpjp.v7.2.1523 :
I was scanning the javadocs, and haven't been able to find a comprehensive list of all valid attributes (e.g. "dos:hidden") for use in java.nio.file.Files.setAttribute. Are they listed somewhere, or do you just have to remember them based on the operating system you are using?
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1523 :
You need to refer to BasicFileAttributeView, DosFileAttributeView, and PosixFileAttributeView
http://docs.oracle.com/javase/7/docs/ap ... eView.html
http://docs.oracle.com/javase/7/docs/ap ... eView.html
If you like our products and services, please help us by posting your review here.
-
- Posts: 9
- Joined: Fri Oct 09, 2015 3:52 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1523 :
That helps, thanks. For anyone else, I discovered that while the attributes are listed in the respective XAttributesView javadoc, the name (e.g. "dos:" prefix) is defined by the name() function of those classes.
e.g.
DosFileAttributeView dosAttributesView = Files.getFileAttributeView(p, DosFileAttributeView.class);
System.out.println("DosFileAttributes view name is "+ dosAttributesView.name());
e.g.
DosFileAttributeView dosAttributesView = Files.getFileAttributeView(p, DosFileAttributeView.class);
System.out.println("DosFileAttributes view name is "+ dosAttributesView.name());
Who is online
Users browsing this forum: Bing [Bot], marpiva and 48 guests