public class DefaultVirtualFileSystem extends Object implements VirtualFileSystem
| Modifier and Type | Field and Description |
|---|---|
private List<VirtualPath> |
existingPaths |
private ReentrantReadWriteLock |
lock |
ROOT| Constructor and Description |
|---|
DefaultVirtualFileSystem() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delete(VirtualPath virtualFile)
Deletes the file or directory specified by the path received as a parameter.
|
boolean |
exists(VirtualPath virtualFile)
Checks if the path received as a parameter already exists in the file system.
|
int |
getTotalNumberOfFiles()
Returns the number of all the files and folders in the file system.
|
private boolean |
hasSubDirectories(VirtualPath directory) |
private boolean |
isChildOf(VirtualPath parent,
VirtualPath childCandidate) |
List<VirtualPath> |
listChildren(VirtualPath parent)
Lists the files and directories that are directly under the directory specified by the path received as a parameter.
|
boolean |
mkdir(VirtualPath newFile)
Makes a new directory specified by the path received as a parameter.
|
private final ReentrantReadWriteLock lock
private final List<VirtualPath> existingPaths
public boolean mkdir(VirtualPath newFile)
VirtualFileSystemmkdir in interface VirtualFileSystemnewFile - The path that points to the directory that should be created.true if the new directory got created;
false otherwise.public boolean exists(VirtualPath virtualFile)
VirtualFileSystemexists in interface VirtualFileSystemvirtualFile - The path that may or may not exist in the file system.true if the specified path already exists in the file system;
false otherwise.public boolean delete(VirtualPath virtualFile)
VirtualFileSystemdelete in interface VirtualFileSystemvirtualFile - The path pointing to the file or directory that should be deleted.true if the file or directory got deleted;
false otherwise.private boolean hasSubDirectories(VirtualPath directory)
private boolean isChildOf(VirtualPath parent, VirtualPath childCandidate)
public List<VirtualPath> listChildren(VirtualPath parent)
VirtualFileSystemlistChildren in interface VirtualFileSystemparent - The path specifying the directory the contents of which should be listed.public int getTotalNumberOfFiles()
VirtualFileSystemgetTotalNumberOfFiles in interface VirtualFileSystemCopyright © 2023 Apache NiFi Project. All rights reserved.