Class DefaultVirtualFileSystem
java.lang.Object
org.apache.nifi.processors.standard.ftp.filesystem.DefaultVirtualFileSystem
- All Implemented Interfaces:
VirtualFileSystem
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<VirtualPath> private final ReentrantReadWriteLockFields inherited from interface org.apache.nifi.processors.standard.ftp.filesystem.VirtualFileSystem
ROOT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandelete(VirtualPath virtualFile) Deletes the file or directory specified by the path received as a parameter.booleanexists(VirtualPath virtualFile) Checks if the path received as a parameter already exists in the file system.intReturns the number of all the files and folders in the file system.private booleanhasSubDirectories(VirtualPath directory) private booleanisChildOf(VirtualPath parent, VirtualPath childCandidate) listChildren(VirtualPath parent) Lists the files and directories that are directly under the directory specified by the path received as a parameter.booleanmkdir(VirtualPath newFile) Makes a new directory specified by the path received as a parameter.
-
Field Details
-
lock
-
existingPaths
-
-
Constructor Details
-
DefaultVirtualFileSystem
public DefaultVirtualFileSystem()
-
-
Method Details
-
mkdir
Description copied from interface:VirtualFileSystemMakes a new directory specified by the path received as a parameter.- Specified by:
mkdirin interfaceVirtualFileSystem- Parameters:
newFile- The path that points to the directory that should be created.- Returns:
trueif the new directory got created;falseotherwise.
-
exists
Description copied from interface:VirtualFileSystemChecks if the path received as a parameter already exists in the file system.- Specified by:
existsin interfaceVirtualFileSystem- Parameters:
virtualFile- The path that may or may not exist in the file system.- Returns:
trueif the specified path already exists in the file system;falseotherwise.
-
delete
Description copied from interface:VirtualFileSystemDeletes the file or directory specified by the path received as a parameter.- Specified by:
deletein interfaceVirtualFileSystem- Parameters:
virtualFile- The path pointing to the file or directory that should be deleted.- Returns:
trueif the file or directory got deleted;falseotherwise.
-
hasSubDirectories
-
isChildOf
-
listChildren
Description copied from interface:VirtualFileSystemLists the files and directories that are directly under the directory specified by the path received as a parameter.- Specified by:
listChildrenin interfaceVirtualFileSystem- Parameters:
parent- The path specifying the directory the contents of which should be listed.- Returns:
- The list of paths that point to the contents of the parent directory.
-
getTotalNumberOfFiles
public int getTotalNumberOfFiles()Description copied from interface:VirtualFileSystemReturns the number of all the files and folders in the file system.- Specified by:
getTotalNumberOfFilesin interfaceVirtualFileSystem- Returns:
- The number of files and folders in the file system.
-