Package adams.core.io.lister
Class AbstractDirectoryLister
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.io.lister.AbstractDirectoryLister
-
- All Implemented Interfaces:
DirectoryLister,LoggingLevelHandler,LoggingSupporter,SizeOfHandler,Stoppable,StoppableWithFeedback,Serializable
- Direct Known Subclasses:
AbstractRecursiveDirectoryLister
public abstract class AbstractDirectoryLister extends CustomLoggingLevelObject implements DirectoryLister
Ancestor for directory listers.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_ListDirswhether to list directories.protected booleanm_ListFileswhether to list files.protected intm_MaxItemsthe maximum number of files/dirs to return.protected BaseRegExpm_RegExpthe regular expression for the files/dirs to match.protected booleanm_SortDescendingwhether to sort descending.protected Sortingm_Sortingthe type of sorting to perform.protected booleanm_Stoppedwhether to stop the currently listing.protected Stringm_WatchDirthe directory to watch.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractDirectoryLister()Initializes the object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetDebug()Returns whether debugging is turned on.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.booleanisStopped()Checks whether the list generation has been stopped.voidsetDebug(boolean value)Set debugging mode.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.voidstopExecution()Stops the current list generation.StringtoString()A string representation of the object.-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.io.lister.DirectoryLister
hasParentDirectory, isLocal, list, listObjects, newDirectory, newDirectory
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
-
-
-
Field Detail
-
m_WatchDir
protected String m_WatchDir
the directory to watch.
-
m_ListDirs
protected boolean m_ListDirs
whether to list directories.
-
m_ListFiles
protected boolean m_ListFiles
whether to list files.
-
m_Sorting
protected Sorting m_Sorting
the type of sorting to perform.
-
m_SortDescending
protected boolean m_SortDescending
whether to sort descending.
-
m_MaxItems
protected int m_MaxItems
the maximum number of files/dirs to return.
-
m_RegExp
protected BaseRegExp m_RegExp
the regular expression for the files/dirs to match.
-
m_Stopped
protected boolean m_Stopped
whether to stop the currently listing.
-
-
Method Detail
-
setDebug
public void setDebug(boolean value)
Set debugging mode.- Parameters:
value- true if debug output should be printed
-
getDebug
public boolean getDebug()
Returns whether debugging is turned on.- Returns:
- true if debugging output is on
-
setWatchDir
public void setWatchDir(String value)
Sets the directory to watch.- Specified by:
setWatchDirin interfaceDirectoryLister- Parameters:
value- the directory
-
getWatchDir
public String getWatchDir()
Returns the directory to watch.- Specified by:
getWatchDirin interfaceDirectoryLister- Returns:
- the directory
-
setListDirs
public void setListDirs(boolean value)
Sets whether to list directories or not.- Specified by:
setListDirsin interfaceDirectoryLister- Parameters:
value- true if directories are included in the list
-
getListDirs
public boolean getListDirs()
Returns whether to list directories or not.- Specified by:
getListDirsin interfaceDirectoryLister- Returns:
- true if directories are listed
-
setListFiles
public void setListFiles(boolean value)
Sets whether to list files or not.- Specified by:
setListFilesin interfaceDirectoryLister- Parameters:
value- true if files are included in the list
-
getListFiles
public boolean getListFiles()
Returns whether to list files or not.- Specified by:
getListFilesin interfaceDirectoryLister- Returns:
- true if files are listed
-
setSorting
public void setSorting(Sorting value)
Sets the sorting type.- Specified by:
setSortingin interfaceDirectoryLister- Parameters:
value- the sorting
-
getSorting
public Sorting getSorting()
Returns the sorting type.- Specified by:
getSortingin interfaceDirectoryLister- Returns:
- the sorting
-
setSortDescending
public void setSortDescending(boolean value)
Sets whether to sort in descending manner.- Specified by:
setSortDescendingin interfaceDirectoryLister- Parameters:
value- true if desending sort manner
-
getSortDescending
public boolean getSortDescending()
Returns whether to sort in descending manner.- Specified by:
getSortDescendingin interfaceDirectoryLister- Returns:
- true if descending sort manner
-
setMaxItems
public void setMaxItems(int value)
Sets the maximum number of items to return.- Specified by:
setMaxItemsin interfaceDirectoryLister- Parameters:
value- the maximum number, <=0 means unbounded
-
getMaxItems
public int getMaxItems()
Returns the maximum number of items to return.- Specified by:
getMaxItemsin interfaceDirectoryLister- Returns:
- the maximum number, <=0 means unbounded
-
setRegExp
public void setRegExp(BaseRegExp value)
Sets the regular expressions that the items have to match.- Specified by:
setRegExpin interfaceDirectoryLister- Parameters:
value- the regular expression, "" matches all
-
getRegExp
public BaseRegExp getRegExp()
Returns the regular expression that the items have to match.- Specified by:
getRegExpin interfaceDirectoryLister- Returns:
- the regular expression, "" matches all
-
stopExecution
public void stopExecution()
Stops the current list generation.- Specified by:
stopExecutionin interfaceStoppable
-
isStopped
public boolean isStopped()
Checks whether the list generation has been stopped.- Specified by:
isStoppedin interfaceStoppableWithFeedback- Returns:
- true if stopped
-
-