You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation:
* Create README.md
Tests:
* Update DirectoryVisitorTest - add class members describing the number of files and directories in the test directory, add test case, add test cases
Visitors:
* Rename SingleLevelFileVisitor to DirectoryVisitor
* Rename SingleLevelFileVisitorTest to DirectoryVisitorTest
* Update DirectoryVisitor - add method getFilePaths, improve method getFilePaths, add method getDirectoryPaths
* Update DirectoryVisitorTest - add test case
The concept of a File Visitor is built into the Java Standard Library.
18
+
For more information on the Java Standard Library, see: [java.nio.file.FileVisitor](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/file/FileVisitor.html)
19
+
20
+
#### Directory Visitor
21
+
The more important class in the Visitors module is the `Directory Visitor`.
22
+
This class requires a Path to be given in the constructor.
23
+
The path should be a valid directory, otherwise the `isValidDirectory` flag will be false, and all methods will return empty lists.
24
+
25
+
When the given Path is a valid directory, a `Simplified File Visitor` is created that collects the names of files and subdirectories that are the direct descendants (only one level deep).
26
+
The names are stored for the lifetime of the `Directory Visitor`, and can be accessed as a list of Files, or a list of Directories.
27
+
There are convenient methods available that can map the names into Lists of Path objects.
28
+
29
+
#### Simplified File Visitor
30
+
Within the Visitors module, you will also find a `Simplified File Visitor`.
31
+
This is an abstract class that provides reasonable default method implementations for most of the required `FileVisitor` methods.
32
+
It is intended to make other classes in the Visitor Module easier to read by applying the default method implementations for `FileVisitor`.
0 commit comments