public class StreamFilesRecursive extends Object
| Modifier and Type | Method and Description |
|---|---|
static Stream<FileHandle> |
streamFilesRecursive(File directory,
FileSystemAbstraction fs)
Static implementation of
FileSystemAbstraction.streamFilesRecursive(File) that does not require
any external state, other than what is presented through the given FileSystemAbstraction. |
public static Stream<FileHandle> streamFilesRecursive(File directory, FileSystemAbstraction fs) throws IOException
FileSystemAbstraction.streamFilesRecursive(File) that does not require
any external state, other than what is presented through the given FileSystemAbstraction.
Return a stream of file handles for every file in the given directory, and its
sub-directories.
Alternatively, if the File given as an argument refers to a file instead of a directory, then a stream
will be returned with a file handle for just that file.
The stream is based on a snapshot of the file tree, so changes made to the tree using the returned file handles will not be reflected in the stream.
No directories will be returned. Only files. If a file handle ends up leaving a directory empty through a rename or a delete, then the empty directory will automatically be deleted as well. Likewise, if a file is moved to a path where not all of the directories in the path exists, then those missing directories will be created prior to the file rename.
directory - The base directory to start streaming files from, or the specific individual file to stream.fs - The FileSystemAbstraction to use for manipulating files.Stream of FileHandlesIOException - If an I/O error occurs, possibly with the canonicalisation of the paths.Copyright © 2002–2018 The Neo4j Graph Database Project. All rights reserved.