Package org.eclipse.jetty.util
Class Scanner
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.Scanner
- All Implemented Interfaces:
LifeCycle
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
Scanner
Utility for scanning a directory for added, removed and changed
files and reporting these events via registered Listeners.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDeprecated.static interfaceDeprecated.static interfaceDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static enumDeprecated.static interfaceDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static interfaceDeprecated.Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.When walking a directory, a depth of 1 ensures that the directory's descendants are visited, not just the directory itself (as a file).static final intDeprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDirectory(Path p) Deprecated.Add a directory to be scanned.voidDeprecated.Add a file to be scanned.voidaddListener(Scanner.Listener listener) Deprecated.Add an added/removed/changed listenervoidaddScanDir(File dir) Deprecated.voiddoStart()Deprecated.Start the scanning action.voiddoStop()Deprecated.Stop the scanning.booleanDeprecated.Deprecated.booleanDeprecated.booleanDeprecated.booleanDeprecated.intDeprecated.Get the scanDepth.Deprecated.intDeprecated.Get the scan intervalDeprecated.newTimer()Deprecated.Deprecated.voidremoveListener(Scanner.Listener listener) Deprecated.Remove a registered listenervoidreset()Deprecated.Clear the list of scannables.voidscan()Deprecated.Perform a pass of the scanner and report changesvoidDeprecated.Scan all of the given paths.voidschedule()Deprecated.voidsetFilenameFilter(FilenameFilter filter) Deprecated.voidsetRecursive(boolean recursive) Deprecated.voidsetReportDirs(boolean dirs) Deprecated.Set if found directories should be reported.voidsetReportExistingFilesOnStartup(boolean reportExisting) Deprecated.Whether or not an initial scan will report all files as being added.voidsetScanDepth(int scanDepth) Deprecated.Set the scanDepth.voidsetScanDirs(List<File> dirs) Deprecated.voidsetScanInterval(int scanInterval) Deprecated.Set the scan intervalMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop, toString
-
Field Details
-
DEFAULT_SCAN_DEPTH
public static final int DEFAULT_SCAN_DEPTHDeprecated.When walking a directory, a depth of 1 ensures that the directory's descendants are visited, not just the directory itself (as a file).- See Also:
-
MAX_SCAN_DEPTH
public static final int MAX_SCAN_DEPTHDeprecated.- See Also:
-
-
Constructor Details
-
Scanner
public Scanner()Deprecated.
-
-
Method Details
-
getScanInterval
public int getScanInterval()Deprecated.Get the scan interval- Returns:
- interval between scans in seconds
-
setScanInterval
public void setScanInterval(int scanInterval) Deprecated.Set the scan interval- Parameters:
scanInterval- pause between scans in seconds, or 0 for no scan after the initial scan.
-
setScanDirs
Deprecated. -
addScanDir
Deprecated. -
addFile
Deprecated.Add a file to be scanned. The file must not be null, and must exist.- Parameters:
p- the Path of the file to scan.- Throws:
IOException
-
addDirectory
Deprecated.Add a directory to be scanned. The directory must not be null and must exist.- Parameters:
p- the directory to scan.- Returns:
- an IncludeExcludeSet to which the caller can add PathMatcher patterns to match
- Throws:
IOException
-
getScanDirs
Deprecated. -
getScannables
Deprecated. -
setRecursive
Deprecated.- Parameters:
recursive- True if scanning is recursive- See Also:
-
getRecursive
Deprecated.- Returns:
- True if scanning is recursive
- See Also:
-
getScanDepth
public int getScanDepth()Deprecated.Get the scanDepth.- Returns:
- the scanDepth
-
setScanDepth
public void setScanDepth(int scanDepth) Deprecated.Set the scanDepth.- Parameters:
scanDepth- the scanDepth to set
-
setFilenameFilter
Deprecated.Apply a filter to files found in the scan directory. Only files matching the filter will be reported as added/changed/removed.- Parameters:
filter- the filename filter to use
-
getFilenameFilter
Deprecated.Get any filter applied to files in the scan dir.- Returns:
- the filename filter
-
setReportExistingFilesOnStartup
public void setReportExistingFilesOnStartup(boolean reportExisting) Deprecated.Whether or not an initial scan will report all files as being added.- Parameters:
reportExisting- if true, all files found on initial scan will be reported as being added, otherwise not
-
getReportExistingFilesOnStartup
public boolean getReportExistingFilesOnStartup()Deprecated. -
setReportDirs
public void setReportDirs(boolean dirs) Deprecated.Set if found directories should be reported.- Parameters:
dirs- true to report directory changes as well
-
getReportDirs
public boolean getReportDirs()Deprecated. -
addListener
Deprecated.Add an added/removed/changed listener- Parameters:
listener- the listener to add
-
removeListener
Deprecated.Remove a registered listener- Parameters:
listener- the Listener to be removed
-
doStart
public void doStart()Deprecated.Start the scanning action. -
newTimerTask
Deprecated. -
newTimer
Deprecated. -
schedule
public void schedule()Deprecated. -
doStop
public void doStop()Deprecated.Stop the scanning. -
reset
public void reset()Deprecated.Clear the list of scannables. The scanner must first be in the stopped state. -
exists
Deprecated.- Parameters:
path- tests if the path exists- Returns:
- true if the path exists in one of the scandirs
-
scan
public void scan()Deprecated.Perform a pass of the scanner and report changes -
scanFiles
public void scanFiles()Deprecated.Scan all of the given paths.
-