Class FsDataFolder

java.lang.Object
org.fastnate.data.files.FsDataFolder
All Implemented Interfaces:
DataFolder

public class FsDataFolder extends Object implements DataFolder
Represents a folder from the file system.
Author:
Tobias Liefke
  • Constructor Details

    • FsDataFolder

      public FsDataFolder(File folder)
      Creates a new FsDataFolder instance.
      Parameters:
      folder - The directory from the filesystem
  • Method Details

    • findFile

      public DataFile findFile(String name)
      Description copied from interface: DataFolder
      Finds a file in this folder.
      Specified by:
      findFile in interface DataFolder
      Parameters:
      name - the name of the file
      Returns:
      the file or null if no file with such a name exists
    • findFolder

      public DataFolder findFolder(String name)
      Description copied from interface: DataFolder
      Finds a sub folder in this folder.
      Specified by:
      findFolder in interface DataFolder
      Parameters:
      name - the name of the sub folder
      Returns:
      the sub folder or null if no folder with such a name exists
    • getFiles

      public List<FsDataFile> getFiles()
      Description copied from interface: DataFolder
      Finds all files inside this folder. Will not return a file from a sub folder
      Specified by:
      getFiles in interface DataFolder
      Returns:
      the files in this folder
    • getFolders

      public List<FsDataFolder> getFolders()
      Description copied from interface: DataFolder
      Finds the all sub folders inside this folder.
      Specified by:
      getFolders in interface DataFolder
      Returns:
      the direct children of this folder
    • getName

      public String getName()
      Description copied from interface: DataFolder
      The name of this folder.
      Specified by:
      getName in interface DataFolder
      Returns:
      the name of this folder, empty or null for the root folder
    • getParent

      public DataFolder getParent()
      Description copied from interface: DataFolder
      The parent folder of this folder.
      Specified by:
      getParent in interface DataFolder
      Returns:
      the parent or null if this folder is the root folder
    • getFolder

      public File getFolder()
      The directory from the filesystem