APIdia Launch Partner
Top Description Constructors Methods
java.nio.file

public Class SimpleFileVisitor<T>

extends Object
implements FileVisitor<T>
Class Inheritance
All Implemented Interfaces
java.nio.file.FileVisitor
Type Parameters
<T>
The type of reference to the files
Imports
java.nio.file.attribute.BasicFileAttributes, java.io.IOException, java.util.Objects

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

AccessConstructor and Description
protected
SimpleFileVisitor()

Initializes a new instance of this class.

Method Summary

Modifier and TypeMethod and Description
public FileVisitResult
postVisitDirectory(T dir, IOException exc)

Implements java.nio.file.FileVisitor.postVisitDirectory.

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

public FileVisitResult
preVisitDirectory(T dir, BasicFileAttributes attrs)

Implements java.nio.file.FileVisitor.preVisitDirectory.

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

public FileVisitResult
visitFile(T file, BasicFileAttributes attrs)

Implements java.nio.file.FileVisitor.visitFile.

Invoked for a file in a directory.

public FileVisitResult
visitFileFailed(T file, IOException exc)

Implements java.nio.file.FileVisitor.visitFileFailed.

Invoked for a file that could not be visited.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SimpleFileVisitorback to summary
protected SimpleFileVisitor()

Initializes a new instance of this class.

Method Detail

postVisitDirectoryback to summary
public FileVisitResult postVisitDirectory(T dir, IOException exc) throws IOException

Implements java.nio.file.FileVisitor.postVisitDirectory.

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 re-throws the I/O exception that caused the iteration of the directory to terminate prematurely.

Annotations
@Override
Exceptions
IOException:

Doc from java.nio.file.FileVisitor.postVisitDirectory.

if an I/O error occurs

preVisitDirectoryback to summary
public FileVisitResult preVisitDirectory(T dir, BasicFileAttributes attrs) throws IOException

Implements java.nio.file.FileVisitor.preVisitDirectory.

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

Unless overridden, this method returns CONTINUE.

Annotations
@Override
Exceptions
IOException:

Doc from java.nio.file.FileVisitor.preVisitDirectory.

if an I/O error occurs

visitFileback to summary
public FileVisitResult visitFile(T file, BasicFileAttributes attrs) throws IOException

Implements java.nio.file.FileVisitor.visitFile.

Invoked for a file in a directory.

Unless overridden, this method returns CONTINUE.

Annotations
@Override
Exceptions
IOException:

Doc from java.nio.file.FileVisitor.visitFile.

if an I/O error occurs

visitFileFailedback to summary
public FileVisitResult visitFileFailed(T file, IOException exc) throws IOException

Implements java.nio.file.FileVisitor.visitFileFailed.

Invoked for a file that could not be visited.

Unless overridden, this method re-throws the I/O exception that prevented the file from being visited.

Annotations
@Override
Exceptions
IOException:

Doc from java.nio.file.FileVisitor.visitFileFailed.

if an I/O error occurs