Class LocalFileSearch
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<AbstractFileSystemSearchlet>,SizeOfHandler,Stoppable,StoppableWithFeedback,FlowContextHandler,Serializable
- Direct Known Subclasses:
LocalFileSearchWithTimestampConstraints
public class LocalFileSearch extends AbstractLocalDirectoryListerBasedSearchlet
Searches only for files.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-directory <adams.core.io.PlaceholderDirectory> (property: directory) The directory to search for files. default: ${CWD}-max-items <int> (property: maxItems) The maximum number of files to return (<= 0 is unlimited). default: -1
-regexp <adams.core.base.BaseRegExp> (property: regExp) The regular expression that the files must match (empty string matches all ). default:
-sorting <NO_SORTING|SORT_BY_NAME|SORT_BY_LAST_MODIFIED> (property: sorting) The type of sorting to perform. default: NO_SORTING
-descending <boolean> (property: sortDescending) If set to true, the files are sorted in descending manner. default: false
-recursive <boolean> (property: recursive) Whether to search recursively or not. default: false
-max-depth <int> (property: maxDepth) The maximum depth to search in recursive mode (1 = only watch directory, -1 = infinite). default: -1
-use-relative-paths <boolean> (property: useRelativePaths) If enabled, paths relative to the specified directory. default: false
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.flow.source.filesystemsearch.AbstractLocalDirectoryListerBasedSearchlet
m_Lister
-
Fields inherited from class adams.flow.source.filesystemsearch.AbstractFileSystemSearchlet
m_FlowContext, m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description LocalFileSearch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.StringdirectoryTipText()Returns the tip text for this property.PlaceholderDirectorygetDirectory()Returns the directory to search.intgetMaxDepth()Returns the maximum depth to search (in recursive mode). 1 = only watch directory, -1 = infinite.intgetMaxItems()Returns the maximum number of items to return.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.booleangetRecursive()Returns whether search is recursively.BaseRegExpgetRegExp()Returns the regular expression for the files/dirs.booleangetSortDescending()Returns whether to sort descendingly.SortinggetSorting()Returns the type of sorting to perform.booleangetUseRelativePaths()Returns whether to output relative paths.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the members.StringmaxDepthTipText()Returns the tip text for this property.StringmaxItemsTipText()Returns the tip text for this property.StringrecursiveTipText()Returns the tip text for this property.StringregExpTipText()Returns the tip text for this property.voidsetDirectory(PlaceholderDirectory value)Sets the directory to search.voidsetMaxDepth(int value)Sets the maximum depth to search (in recursive mode). 1 = only watch directory, -1 = infinite.voidsetMaxItems(int value)Sets the maximum number of items to return.voidsetRecursive(boolean value)Sets whether to search recursively.voidsetRegExp(BaseRegExp value)Sets the regular expression for the files/dirs.voidsetSortDescending(boolean value)Sets whether to sort descendingly.voidsetSorting(Sorting value)Sets the type of sorting to perform.voidsetUseRelativePaths(boolean value)Sets whether to output relative paths.StringsortDescendingTipText()Returns the tip text for this property.StringsortingTipText()Returns the tip text for this property.StringuseRelativePathsTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.source.filesystemsearch.AbstractLocalDirectoryListerBasedSearchlet
doSearch, setLoggingLevel, stopExecution
-
Methods inherited from class adams.flow.source.filesystemsearch.AbstractFileSystemSearchlet
check, getFlowContext, isStopped, search, setFlowContext, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
-
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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractLocalDirectoryListerBasedSearchlet
-
setDirectory
public void setDirectory(PlaceholderDirectory value)
Sets the directory to search.- Parameters:
value- the directory
-
getDirectory
public PlaceholderDirectory getDirectory()
Returns the directory to search.- Returns:
- the directory.
-
directoryTipText
public String directoryTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaxItems
public void setMaxItems(int value)
Sets the maximum number of items to return.- Parameters:
value- the maximum number
-
getMaxItems
public int getMaxItems()
Returns the maximum number of items to return.- Returns:
- the maximum number
-
maxItemsTipText
public String maxItemsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRegExp
public void setRegExp(BaseRegExp value)
Sets the regular expression for the files/dirs.- Parameters:
value- the regular expression
-
getRegExp
public BaseRegExp getRegExp()
Returns the regular expression for the files/dirs.- Returns:
- the regular expression
-
regExpTipText
public String regExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSorting
public void setSorting(Sorting value)
Sets the type of sorting to perform.- Parameters:
value- the type of sorting
-
getSorting
public Sorting getSorting()
Returns the type of sorting to perform.- Returns:
- the type of sorting
-
sortingTipText
public String sortingTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSortDescending
public void setSortDescending(boolean value)
Sets whether to sort descendingly.- Parameters:
value- true if sorting in descending order
-
getSortDescending
public boolean getSortDescending()
Returns whether to sort descendingly.- Returns:
- true if sorting in descending order
-
sortDescendingTipText
public String sortDescendingTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setRecursive
public void setRecursive(boolean value)
Sets whether to search recursively.- Parameters:
value- true if search is recursively
-
getRecursive
public boolean getRecursive()
Returns whether search is recursively.- Returns:
- true if search is recursively
-
recursiveTipText
public String recursiveTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMaxDepth
public void setMaxDepth(int value)
Sets the maximum depth to search (in recursive mode). 1 = only watch directory, -1 = infinite.- Parameters:
value- the maximum number of directory levels to traverse
-
getMaxDepth
public int getMaxDepth()
Returns the maximum depth to search (in recursive mode). 1 = only watch directory, -1 = infinite.- Returns:
- the maximum number of directory levels to traverse
-
maxDepthTipText
public String maxDepthTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseRelativePaths
public void setUseRelativePaths(boolean value)
Sets whether to output relative paths.- Parameters:
value- true if to output relative paths
-
getUseRelativePaths
public boolean getUseRelativePaths()
Returns whether to output relative paths.- Returns:
- true if to output relative paths
-
useRelativePathsTipText
public String useRelativePathsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractFileSystemSearchlet- Returns:
- null if no info available, otherwise short string
-
-