Package com.jackmeng.locale
Class PhysicalFolder
java.lang.Object
com.jackmeng.locale.PhysicalFolder
- Direct Known Subclasses:
VirtualFolder
A simple class that inits and holds
a folder information.
- Since:
- 3.1
- Author:
- Jack Meng
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPhysicalFolder
(String absolutePath) Constructs the folder-info object instance with the specified path. -
Method Summary
Modifier and TypeMethodDescriptionReturns the absolute path of the folder-info object.File[]
getFiles()
Returns all of the files within the folderFile[]
String[]
Returns the Files (not sub-folders) in the folder-info object or the folder as the file's names.String[]
getFilesAsStr
(String... rules) Returns an array of String in which each String represents a file inside the folder (absolute path).getName()
Get this folder's nametoString()
Represents the folder-info object as a string.
-
Field Details
-
absPath
-
-
Constructor Details
-
PhysicalFolder
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
Returns the absolute path of the folder-info object.- Returns:
- The absolute path of the folder-info object.
-
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
Returns all of the files within the folder- Returns:
- File array
-
getName
Get this folder's name- Returns:
- A String
-
getFilesAsStr
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
- Parameters:
rules
- An array of extensions to search for and compare to.- Returns:
- An array of Files with the specified extension.
-
toString
Represents the folder-info object as a string.
-