Package org.fastnate.data.files
Class VfsDataFolder
java.lang.Object
org.fastnate.data.files.VfsDataFolder
- All Implemented Interfaces:
DataFolder
Represents a folder from the class path.
Wraps a set of
Vfs.Dirs.- Author:
- Tobias Liefke
-
Constructor Summary
ConstructorsConstructorDescriptionVfsDataFolder(List<org.reflections.vfs.Vfs.Dir> dirs) Creates a new root folder.VfsDataFolder(List<org.reflections.vfs.Vfs.Dir> dirs, VfsDataFolder parent, String relativePath, String name) Creates a newVfsDataFolderinstance. -
Method Summary
Modifier and TypeMethodDescriptionFinds a file in this folder.findFolder(String folderName) Finds a sub folder in this folder.getFiles()Finds all files inside this folder.Finds the all sub folders inside this folder.getName()The name of this folder,nullif this represents the root folder.The parent directory,nullif this represents the root folder.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.fastnate.data.files.DataFolder
forAllFiles, forAllFiles, getFolder, getPath
-
Constructor Details
-
VfsDataFolder
Creates a new root folder.- Parameters:
dirs- the directories that represent the root of the data folder
-
VfsDataFolder
public VfsDataFolder(List<org.reflections.vfs.Vfs.Dir> dirs, VfsDataFolder parent, String relativePath, String name) Creates a newVfsDataFolderinstance.- Parameters:
dirs- All root directories.parent- The parent directory,nullif this represents the root folder.relativePath- The full path to this folder fromdirs,nullif this represents the root folder.name- The name of this folder,nullif this represents the root folder.
-
-
Method Details
-
findFile
Description copied from interface:DataFolderFinds a file in this folder.- Specified by:
findFilein interfaceDataFolder- Parameters:
fileName- the name of the file- Returns:
- the file or
nullif no file with such a name exists
-
findFolder
Description copied from interface:DataFolderFinds a sub folder in this folder.- Specified by:
findFolderin interfaceDataFolder- Parameters:
folderName- the name of the sub folder- Returns:
- the sub folder or
nullif no folder with such a name exists
-
getFiles
Description copied from interface:DataFolderFinds all files inside this folder. Will not return a file from asub folder- Specified by:
getFilesin interfaceDataFolder- Returns:
- the files in this folder
-
getFolders
Description copied from interface:DataFolderFinds the all sub folders inside this folder.- Specified by:
getFoldersin interfaceDataFolder- Returns:
- the direct children of this folder
-
getParent
The parent directory,nullif this represents the root folder.- Specified by:
getParentin interfaceDataFolder- Returns:
- the parent or
nullif this folder is the root folder
-
getName
The name of this folder,nullif this represents the root folder.- Specified by:
getNamein interfaceDataFolder- Returns:
- the name of this folder, empty or
nullfor the root folder
-