Package digilib.io
Class FsDirectory
- java.lang.Object
-
- digilib.io.FsDirectory
-
public class FsDirectory extends Object
Class for filesystem directories- Author:
- casties
-
-
Constructor Summary
Constructors Constructor Description FsDirectory()
Default 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearFilenames()
Resets the filenames.File
getDir()
Returns the directory File object.String[]
getFilenames()
Returns the filenames.FsDirectory
getParent()
Returns the parent Directory object.boolean
readDir()
Reads the names of the files in the directory.void
setDir(File dir)
Sets the directory File object.void
setFilenames(String[] filenames)
Sets the filenames.void
setParent(FsDirectory parent)
Sets the parent Directory object.Path
toPath()
Returns the directory as Path object.
-
-
-
Field Detail
-
logger
protected org.slf4j.Logger logger
-
dir
protected File dir
File object pointing to the directory
-
parent
protected FsDirectory parent
parent directory
-
list
protected String[] list
list of filenames in the directory
-
-
Constructor Detail
-
FsDirectory
public FsDirectory()
Default constructor.
-
FsDirectory
public FsDirectory(File d)
Constructor taking a File object.- Parameters:
d
- the File
-
FsDirectory
public FsDirectory(File dir, FsDirectory parent)
Constructor taking a File object and a parent.- Parameters:
dir
- the Fileparent
- the Directory
-
FsDirectory
public FsDirectory(String dn)
Constructor taking a directory name.- Parameters:
dn
- the name
-
-
Method Detail
-
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
public File getDir()
Returns the directory File object.- Returns:
- the File
-
toPath
public Path toPath()
Returns the directory as Path object.- Returns:
-
setDir
public void setDir(File dir)
Sets the directory File object.- Parameters:
dir
- the File
-
getParent
public FsDirectory getParent()
Returns the parent Directory object.- Returns:
- the Directory
-
setParent
public void setParent(FsDirectory parent)
Sets the parent Directory object.- Parameters:
parent
- the Directory
-
getFilenames
public String[] getFilenames()
Returns the filenames.- Returns:
- the filenames
-
setFilenames
public void setFilenames(String[] filenames)
Sets the filenames.- Parameters:
filenames
- the filenames
-
clearFilenames
public void clearFilenames()
Resets the filenames.
-
-