java.nio.file
Class SimpleFileVisitor<T>

java.lang.Object
  extended by java.nio.file.SimpleFileVisitor<T>
Type Parameters:
T - The type of reference to the files
All Implemented Interfaces:
FileVisitor<T>

public class SimpleFileVisitor<T>
extends Object
implements FileVisitor<T>

Disabled: no SafeJ information.

A simple visitor of files with default behavior to visit all files and to re-throw I/O errors.

Methods in this class may be overridden subject to their general contract.

Since:
1.7

Constructor Summary
protected SimpleFileVisitor()
          Initializes a new instance of this class.
 
Method Summary
 FileVisitResult postVisitDirectory(T dir, IOException exc)
          Invoked for a directory after entries in the directory, and all of their descendants, have been visited.
 FileVisitResult preVisitDirectory(T dir)
          Invoked for a directory before entries in the directory are visited.
 FileVisitResult preVisitDirectoryFailed(T dir, IOException exc)
          Invoked for a directory that could not be opened.
 FileVisitResult visitFile(T file, BasicFileAttributes attrs)
          Invoked for a file in a directory.
 FileVisitResult visitFileFailed(T file, IOException exc)
          Invoked for a file when its basic file attributes could not be read.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFileVisitor

protected SimpleFileVisitor()
Class is disabled.

Initializes a new instance of this class.

Method Detail

preVisitDirectory

public FileVisitResult preVisitDirectory(T dir)
Class is disabled.

Invoked for a directory before entries in the directory are visited.

Unless overridden, this method returns CONTINUE.

Specified by:
preVisitDirectory in interface FileVisitor<T>
Parameters:
dir - a reference to the directory
Returns:
the visit result

preVisitDirectoryFailed

public FileVisitResult preVisitDirectoryFailed(T dir,
                                               IOException exc)
Class is disabled.

Invoked for a directory that could not be opened.

Unless overridden, this method throws IOError with the I/O exception as cause.

Specified by:
preVisitDirectoryFailed in interface FileVisitor<T>
Parameters:
dir - a reference to the directory
exc - the I/O exception thrown from the attempt to open the directory
Returns:
the visit result
Throws:
IOError - with the I/O exception thrown when the attempt to open the directory failed

visitFile

public FileVisitResult visitFile(T file,
                                 BasicFileAttributes attrs)
Class is disabled.

Invoked for a file in a directory.

Unless overridden, this method returns CONTINUE.

Specified by:
visitFile in interface FileVisitor<T>
Parameters:
file - a reference to the file
attrs - the file's basic attributes
Returns:
the visit result

visitFileFailed

public FileVisitResult visitFileFailed(T file,
                                       IOException exc)
Class is disabled.

Invoked for a file when its basic file attributes could not be read.

Unless overridden, this method throws IOError with the I/O exception as cause.

Specified by:
visitFileFailed in interface FileVisitor<T>
Parameters:
file - a reference to the file
exc - the I/O exception thrown from the attempt to read the file attributes
Returns:
the visit result
Throws:
IOError - with the I/O exception thrown when the attempt to read the file attributes failed

postVisitDirectory

public FileVisitResult postVisitDirectory(T dir,
                                          IOException exc)
Class is disabled.

Invoked for a directory after entries in the directory, and all of their descendants, have been visited.

Unless overridden, this method returns CONTINUE if the directory iteration completes without an I/O exception; otherwise this method throws IOError with the I/O exception as cause.

Specified by:
postVisitDirectory in interface FileVisitor<T>
Parameters:
dir - a reference to the directory
exc - null if the iteration of the directory completes without an error; otherwise the I/O exception that caused the iteration of the directory to complete prematurely
Returns:
the visit result
Throws:
IOError - with the I/O exception thrown when iteration of the directory completed prematurely due to an I/O error