About Question enthuware.ocpjp.v7.2.1523 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
kemosabe
Posts: 9
Joined: Fri Oct 09, 2015 3:52 am
Contact:

About Question enthuware.ocpjp.v7.2.1523 :

Post by kemosabe »

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?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1523 :

Post by admin »

You need to refer to BasicFileAttributeView, DosFileAttributeView, and PosixFileAttributeView

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.

kemosabe
Posts: 9
Joined: Fri Oct 09, 2015 3:52 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1523 :

Post by kemosabe »

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());

Post Reply

Who is online

Users browsing this forum: Bing [Bot], marpiva and 48 guests