wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 7552
    
  18

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Difference between a FileAttribute and a FileAttributeView.
 
Similar Threads
Writing an audio file in internal memory
Upload Image File Tomcat - File Path Not read in UNIX
Image formats allowed
HFSJ final mock exam quetion 54 - taglib and uri
HTML links not linking properly