This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Difference between a FileAttribute and a FileAttributeView. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Difference between a FileAttribute and a FileAttributeView." Watch "Difference between a FileAttribute and a FileAttributeView." New topic
Author

Difference between a FileAttribute and a FileAttributeView.

Nick Widelec
Ranch Hand

Joined: Feb 28, 2013
Posts: 226

Basically I have these snippet:


Why would I use pfav at all? if most of the time using pfav implies calling .readAttributes() which in turn returns a PosixFileAttributes object.

Bottom line: I would like to know what is the use of a View, why should I use it, in which circumstances it is useful instead of directly using a "TypeFileAttributes".

Thanks in advance.


OCAJP 7, OCPJP 7
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8042
    
  22

Nick Widelec wrote:Bottom line: I would like to know what is the use of a View, why should I use it, in which circumstances it is useful instead of directly using a "TypeFileAttributes".

Well, from what I can see - although I've never used the classes - it's mandated by the docs.

As to why: You'd probably have to ask the designers. Or possibly there's a Java 7 tutorial around that explains the reasons.

As to TypeFileAttributes: I have no idea - I wasn't able to find any reference to such an animal via a quick Google search.

I wonder if this thread might be better suited to our Java 7 forum. If so, let me know and I'll move it.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
Don't get me started about those stupid light bulbs.
 
subject: Difference between a FileAttribute and a FileAttributeView.