Package adams.core.io.lister
Interface DirectoryLister
-
- All Superinterfaces:
LoggingLevelHandler,LoggingSupporter,Stoppable,StoppableWithFeedback
- All Known Subinterfaces:
RecursiveDirectoryLister,RelativeDirectoryLister
- All Known Implementing Classes:
AbstractDirectoryLister,AbstractRecursiveDirectoryLister,LocalDirectoryLister,SftpDirectoryLister,SmbDirectoryLister
public interface DirectoryLister extends LoggingSupporter, LoggingLevelHandler, StoppableWithFeedback
Interface for directory listers.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleangetListDirs()Returns whether to list directories or not.booleangetListFiles()Returns whether to list files or not.intgetMaxItems()Returns the maximum number of items to return.BaseRegExpgetRegExp()Returns the regular expression that the items have to match.booleangetSortDescending()Returns whether to sort in descending manner.SortinggetSorting()Returns the sorting type.StringgetWatchDir()Returns the directory to watch.booleanhasParentDirectory()Returns whether the watch directory has a parent directory.booleanisLocal()Returns whether the directory lister operates locally or remotely.String[]list()Returns the list of files/directories in the watched directory.FileObject[]listObjects()Returns the list of files/directories in the watched directory.FileObjectnewDirectory(String dir)Returns a new directory relative to the watch directory.FileObjectnewDirectory(String parent, String dir)Returns a new directory generated from parent and sub-directory.voidsetListDirs(boolean value)Sets whether to list directories or not.voidsetListFiles(boolean value)Sets whether to list files or not.voidsetMaxItems(int value)Sets the maximum number of items to return.voidsetRegExp(BaseRegExp value)Sets the regular expressions that the items have to match.voidsetSortDescending(boolean value)Sets whether to sort in descending manner.voidsetSorting(Sorting value)Sets the sorting type.voidsetWatchDir(String value)Sets the directory to watch.-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.Stoppable
stopExecution
-
Methods inherited from interface adams.core.StoppableWithFeedback
isStopped
-
-
-
-
Method Detail
-
setWatchDir
void setWatchDir(String value)
Sets the directory to watch.- Parameters:
value- the directory
-
getWatchDir
String getWatchDir()
Returns the directory to watch.- Returns:
- the directory
-
setListDirs
void setListDirs(boolean value)
Sets whether to list directories or not.- Parameters:
value- true if directories are included in the list
-
getListDirs
boolean getListDirs()
Returns whether to list directories or not.- Returns:
- true if directories are listed
-
setListFiles
void setListFiles(boolean value)
Sets whether to list files or not.- Parameters:
value- true if files are included in the list
-
getListFiles
boolean getListFiles()
Returns whether to list files or not.- Returns:
- true if files are listed
-
setSorting
void setSorting(Sorting value)
Sets the sorting type.- Parameters:
value- the sorting
-
getSorting
Sorting getSorting()
Returns the sorting type.- Returns:
- the sorting
-
setSortDescending
void setSortDescending(boolean value)
Sets whether to sort in descending manner.- Parameters:
value- true if desending sort manner
-
getSortDescending
boolean getSortDescending()
Returns whether to sort in descending manner.- Returns:
- true if descending sort manner
-
setMaxItems
void setMaxItems(int value)
Sets the maximum number of items to return.- Parameters:
value- the maximum number, <=0 means unbounded
-
getMaxItems
int getMaxItems()
Returns the maximum number of items to return.- Returns:
- the maximum number, <=0 means unbounded
-
setRegExp
void setRegExp(BaseRegExp value)
Sets the regular expressions that the items have to match.- Parameters:
value- the regular expression, "" matches all
-
getRegExp
BaseRegExp getRegExp()
Returns the regular expression that the items have to match.- Returns:
- the regular expression, "" matches all
-
isLocal
boolean isLocal()
Returns whether the directory lister operates locally or remotely.- Returns:
- true if local lister
-
hasParentDirectory
boolean hasParentDirectory()
Returns whether the watch directory has a parent directory.- Returns:
- true if parent directory available
-
newDirectory
FileObject newDirectory(String dir)
Returns a new directory relative to the watch directory.- Parameters:
dir- the directory name- Returns:
- the new wrapper
-
newDirectory
FileObject newDirectory(String parent, String dir)
Returns a new directory generated from parent and sub-directory.- Parameters:
parent- the parent directorydir- the directory name- Returns:
- the new wrapper
-
list
String[] list()
Returns the list of files/directories in the watched directory. In case the execution gets stopped, this method returns a 0-length array.- Returns:
- the list of absolute file/directory names
-
listObjects
FileObject[] listObjects()
Returns the list of files/directories in the watched directory. In case the execution gets stopped, this method returns a 0-length array.- Returns:
- the list of file/directory wrappers
-
-