Class PhysicalFolder

java.lang.Object
com.jackmeng.locale.PhysicalFolder
Direct Known Subclasses:
VirtualFolder

public class PhysicalFolder extends Object
A simple class that inits and holds a folder information.
Since:
3.1
Author:
Jack Meng
  • Field Details

    • absPath

      private String absPath
  • Constructor Details

    • PhysicalFolder

      public PhysicalFolder(String absolutePath)
      Constructs the folder-info object instance with the specified path.

      Note: this path does not assert that the entered instance is a folder that exists or the file system has access/permission to.

      Parameters:
      absolutePath - The path to construct the folder-info object with.
  • Method Details

    • getAbsolutePath

      public String getAbsolutePath()
      Returns the absolute path of the folder-info object.
      Returns:
      The absolute path of the folder-info object.
    • getFilesAsStr

      public String[] getFilesAsStr()
      Returns the Files (not sub-folders) in the folder-info object or the folder as the file's names.
      Returns:
      A string array
    • getFiles

      public File[] getFiles()
      Returns all of the files within the folder
      Returns:
      File array
    • getName

      public String getName()
      Get this folder's name
      Returns:
      A String
    • getFilesAsStr

      public String[] getFilesAsStr(String... rules)
      Returns an array of String in which each String represents a file inside the folder (absolute path).
      Parameters:
      rules - An array of extensions to search for and compare to.
      Returns:
      An array of String
    • getFiles

      public File[] getFiles(String... rules)
      Parameters:
      rules - An array of extensions to search for and compare to.
      Returns:
      An array of Files with the specified extension.
    • toString

      public String toString()
      Represents the folder-info object as a string.
      Overrides:
      toString in class Object