Package com.jackmeng.locale
Class VirtualFolder
java.lang.Object
com.jackmeng.locale.PhysicalFolder
com.jackmeng.locale.VirtualFolder
A class that represents a virtual folder,
this virtual folder does not exist on the user's
actual hard drive and is used to represent a virtual
folder that may be used to hold files from different
stuffs.
The entirety of the methods from FolderInfo are overriden in order to completely encompass a "virtual" folder
- Since:
- 3.1
- Author:
- Jack Meng
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVirtualFolder(String name, File... files) A VirtualFolder takes a varargs of file objects in order to represent the folder with files. -
Method Summary
Modifier and TypeMethodDescriptionvoidInsert a file into this virtual folder instance.Returns the absolute list.File[]getFiles()Returns all of the files within the folderFile[]Applies a check against the list of avaliable files.String[]Returns the Files (not sub-folders) in the folder-info object or the folder as the file's names.String[]getFilesAsStr(String... rules) Applies a check against the list of avaliable files.booleanremoveFile(File f) Removes a file from the absolute list.toString()Represents the folder-info object as a string.Methods inherited from class com.jackmeng.locale.PhysicalFolder
getAbsolutePath, getName
-
Field Details
-
list
-
-
Constructor Details
-
VirtualFolder
A VirtualFolder takes a varargs of file objects in order to represent the folder with files.The absolute path of the folder is replaced by a generic name.
- Parameters:
name- The name of the virtual folder.files- The files in the virtual folder.
-
-
Method Details
-
getFilesAsStr
Description copied from class:PhysicalFolderReturns the Files (not sub-folders) in the folder-info object or the folder as the file's names.- Overrides:
getFilesAsStrin classPhysicalFolder- Returns:
- String[] A list of files of their absolute paths in string form
-
getFiles
Description copied from class:PhysicalFolderReturns all of the files within the folder- Overrides:
getFilesin classPhysicalFolder- Returns:
- File[] A list of files of their File object instances (created on call)
-
getFilesAsStr
Applies a check against the list of avaliable files.- Overrides:
getFilesAsStrin classPhysicalFolder- Parameters:
rules- A set of rules to be used to compare the ending of the file (endsWith)- Returns:
- String[] A list of file of their absolute paths in string form
-
getFiles
Applies a check against the list of avaliable files.This uses the method
getFilesAsStr(String...)method for validation.- Overrides:
getFilesin classPhysicalFolder- Parameters:
rules- A set of rules to be used to comapre the ending of the file (endsWith)- Returns:
- File[] A list of file of their respective absolute paths
-
addFile
Insert a file into this virtual folder instance.This method does not handle if this file instance exists or not.
The implementation must handle this by themselves.
- Parameters:
f- A file to insert.
-
getAsListFiles
Returns the absolute list.- Returns:
- A List
-
removeFile
Removes a file from the absolute list.- Parameters:
f- The file instance to remove.- Returns:
- (true | | false) if the action was a success
-
toString
Description copied from class:PhysicalFolderRepresents the folder-info object as a string.- Overrides:
toStringin classPhysicalFolder- Returns:
- String
-