# SimpleFileVisitor

public class **SimpleFileVisitor** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
implements [FileVisitor](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitor.html)\<T\> 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.

### Protected Constructor Summary

|---|---|
|   | [SimpleFileVisitor](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/SimpleFileVisitor.html#SimpleFileVisitor())() Initializes a new instance of this class. |

### Public Method Summary

|---|---|
| [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html) | [postVisitDirectory](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/SimpleFileVisitor.html#postVisitDirectory(T,%20java.io.IOException))(T dir, [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) exc) Invoked for a directory after entries in the directory, and all of their descendants, have been visited. |
| [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html) | [preVisitDirectory](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/SimpleFileVisitor.html#preVisitDirectory(T,%20java.nio.file.attribute.BasicFileAttributes))(T dir, [BasicFileAttributes](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/BasicFileAttributes.html) attrs) Invoked for a directory before entries in the directory are visited. |
| [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html) | [visitFile](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/SimpleFileVisitor.html#visitFile(T,%20java.nio.file.attribute.BasicFileAttributes))(T file, [BasicFileAttributes](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/BasicFileAttributes.html) attrs) Invoked for a file in a directory. |
| [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html) | [visitFileFailed](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/SimpleFileVisitor.html#visitFileFailed(T,%20java.io.IOException))(T file, [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) exc) Invoked for a file that could not be visited. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [java.nio.file.FileVisitor](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitor.html)

|---|---|
| abstract [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html) | [postVisitDirectory](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitor.html#postVisitDirectory(T,%20java.io.IOException))(T dir, [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) exc) Invoked for a directory after entries in the directory, and all of their descendants, have been visited. |
| abstract [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html) | [preVisitDirectory](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitor.html#preVisitDirectory(T,%20java.nio.file.attribute.BasicFileAttributes))(T dir, [BasicFileAttributes](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/BasicFileAttributes.html) attrs) Invoked for a directory before entries in the directory are visited. |
| abstract [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html) | [visitFile](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitor.html#visitFile(T,%20java.nio.file.attribute.BasicFileAttributes))(T file, [BasicFileAttributes](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/BasicFileAttributes.html) attrs) Invoked for a file in a directory. |
| abstract [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html) | [visitFileFailed](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitor.html#visitFileFailed(T,%20java.io.IOException))(T file, [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) exc) Invoked for a file that could not be visited. |

## Protected Constructors

#### protected
**SimpleFileVisitor**
()

Initializes a new instance of this class.

## Public Methods

#### public [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html)
**postVisitDirectory**
(T dir, [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) exc)

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

Unless overridden, this method returns `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html#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.

##### 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

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) |   |
|---|---|

#### public [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html)
**preVisitDirectory**
(T dir, [BasicFileAttributes](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/BasicFileAttributes.html) attrs)

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

Unless overridden, this method returns `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html#CONTINUE`.

##### Parameters

| dir | a reference to the directory |
| attrs | the directory's basic attributes |
|---|---|

##### Returns

- the visit result

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) |   |
|---|---|

#### public [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html)
**visitFile**
(T file, [BasicFileAttributes](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/attribute/BasicFileAttributes.html) attrs)

Invoked for a file in a directory.

Unless overridden, this method returns `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html#CONTINUE`.

##### Parameters

| file | a reference to the file |
| attrs | the file's basic attributes |
|---|---|

##### Returns

- the visit result

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) |   |
|---|---|

#### public [FileVisitResult](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/file/FileVisitResult.html)
**visitFileFailed**
(T file, [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) exc)

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.

##### Parameters

| file | a reference to the file |
| exc | the I/O exception that prevented the file from being visited |
|---|---|

##### Returns

- the visit result

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) |   |
|---|---|