Package digilib.io
Class FsDirectory
java.lang.Object
digilib.io.FsDirectory
Class for filesystem directories
- Author:
- casties
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.FsDirectory(File d) Constructor taking a File object.FsDirectory(File dir, FsDirectory parent) Constructor taking a File object and a parent.FsDirectory(String dn) Constructor taking a directory name. -
Method Summary
Modifier and TypeMethodDescriptionvoidResets the filenames.getDir()Returns the directory File object.String[]Returns the filenames.Returns the parent Directory object.booleanreadDir()Reads the names of the files in the directory.voidSets the directory File object.voidsetFilenames(String[] filenames) Sets the filenames.voidsetParent(FsDirectory parent) Sets the parent Directory object.toPath()Returns the directory as Path object.
-
Field Details
-
logger
protected org.slf4j.Logger logger -
dir
File object pointing to the directory -
parent
parent directory -
list
list of filenames in the directory
-
-
Constructor Details
-
FsDirectory
public FsDirectory()Default constructor. -
FsDirectory
Constructor taking a File object.- Parameters:
d- the File
-
FsDirectory
Constructor taking a File object and a parent.- Parameters:
dir- the Fileparent- the Directory
-
FsDirectory
Constructor taking a directory name.- Parameters:
dn- the name
-
-
Method Details
-
readDir
public boolean readDir()Reads the names of the files in the directory. Fills the filenames array. Returns if the operation was successful.- Returns:
- if the operation was successful
-
getDir
Returns the directory File object.- Returns:
- the File
-
toPath
Returns the directory as Path object.- Returns:
-
setDir
Sets the directory File object.- Parameters:
dir- the File
-
getParent
Returns the parent Directory object.- Returns:
- the Directory
-
setParent
Sets the parent Directory object.- Parameters:
parent- the Directory
-
getFilenames
Returns the filenames.- Returns:
- the filenames
-
setFilenames
Sets the filenames.- Parameters:
filenames- the filenames
-
clearFilenames
public void clearFilenames()Resets the filenames.
-