File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes FileVisitResult Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "FileVisitResult" Watch "FileVisitResult" New topic
Author

FileVisitResult

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305


java.nio.file
Enum FileVisitResult

SKIP_SIBLINGS
Continue without visiting the siblings of this file or directory.
SKIP_SUBTREE
Continue without visiting the entries in this directory.


I do understand SKIP_SUBTREE, but how SKIP_SIBLINGS is different from that ?

Thanks


My one regret in life is that I am not someone else.
- Woody Allen
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2166
    
  47
Have you tried writing some code to see what the difference is?
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Tony Docherty wrote:Have you tried writing some code to see what the difference is?


I tried this.


Initiating root
Initiating dir1
D:\OCJP7\IO\FileIO(WithNIO2)\FileVisitor\root\dir1\dir1file.txt
End of dir1
Initiating dir2
End of root


Initiating root
Initiating dir1
D:\OCJP7\IO\FileIO(WithNIO2)\FileVisitor\root\dir1\dir1file.txt
End of dir1
Initiating dir2
D:\OCJP7\IO\FileIO(WithNIO2)\FileVisitor\root\rootfile.txt
End of root



[untitled.JPG]

Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2166
    
  47
So has that answered your question?
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Tony Docherty wrote:So has that answered your question?
Getting something but not whole.I can get same effect with SKIP_SIBLINGS=(pre)SKIP_SUBTREE+(post)TERMINATE
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2166
    
  47
There probably are several ways to get the same effect by returning combinations of values from different methods, the FileVisitor is very versatile.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FileVisitResult
 
Similar Threads
is there a way to print a custom header/footer in eclipse?
which is faster in List Classes
Need Help with binding click events to table rows
warned?
Is there a JavaRanch equal in the C++ community?