Class DefaultVirtualFileSystem

java.lang.Object
org.apache.nifi.processors.standard.ftp.filesystem.DefaultVirtualFileSystem
All Implemented Interfaces:
VirtualFileSystem

public class DefaultVirtualFileSystem extends Object implements VirtualFileSystem
  • Field Details

  • Constructor Details

    • DefaultVirtualFileSystem

      public DefaultVirtualFileSystem()
  • Method Details

    • mkdir

      public boolean mkdir(VirtualPath newFile)
      Description copied from interface: VirtualFileSystem
      Makes a new directory specified by the path received as a parameter.
      Specified by:
      mkdir in interface VirtualFileSystem
      Parameters:
      newFile - The path that points to the directory that should be created.
      Returns:
      true if the new directory got created; false otherwise.
    • exists

      public boolean exists(VirtualPath virtualFile)
      Description copied from interface: VirtualFileSystem
      Checks if the path received as a parameter already exists in the file system.
      Specified by:
      exists in interface VirtualFileSystem
      Parameters:
      virtualFile - The path that may or may not exist in the file system.
      Returns:
      true if the specified path already exists in the file system; false otherwise.
    • delete

      public boolean delete(VirtualPath virtualFile)
      Description copied from interface: VirtualFileSystem
      Deletes the file or directory specified by the path received as a parameter.
      Specified by:
      delete in interface VirtualFileSystem
      Parameters:
      virtualFile - The path pointing to the file or directory that should be deleted.
      Returns:
      true if the file or directory got deleted; false otherwise.
    • hasSubDirectories

      private boolean hasSubDirectories(VirtualPath directory)
    • isChildOf

      private boolean isChildOf(VirtualPath parent, VirtualPath childCandidate)
    • listChildren

      public List<VirtualPath> listChildren(VirtualPath parent)
      Description copied from interface: VirtualFileSystem
      Lists the files and directories that are directly under the directory specified by the path received as a parameter.
      Specified by:
      listChildren in interface VirtualFileSystem
      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: VirtualFileSystem
      Returns the number of all the files and folders in the file system.
      Specified by:
      getTotalNumberOfFiles in interface VirtualFileSystem
      Returns:
      The number of files and folders in the file system.