Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between a FileAttribute and a FileAttributeView.  RSS feed

 
Ranch Hand
Posts: 226
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!