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(since="2021-05-27") public class Scanner extends AbstractLifeCycle
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 Classes Modifier and Type Class Description static interface
Scanner.BulkListener
Deprecated.static interface
Scanner.DiscreteListener
Deprecated.static interface
Scanner.Listener
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static class
Scanner.Notification
Deprecated.static interface
Scanner.ScanCycleListener
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static interface
Scanner.ScanListener
Deprecated.-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SCAN_DEPTH
Deprecated.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 int
MAX_SCAN_DEPTH
Deprecated.
-
Constructor Summary
Constructors Constructor Description Scanner()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IncludeExcludeSet<java.nio.file.PathMatcher,java.nio.file.Path>
addDirectory(java.nio.file.Path p)
Deprecated.Add a directory to be scanned.void
addFile(java.nio.file.Path p)
Deprecated.Add a file to be scanned.void
addListener(Scanner.Listener listener)
Deprecated.Add an added/removed/changed listenervoid
addScanDir(java.io.File dir)
Deprecated.void
doStart()
Deprecated.Start the scanning action.void
doStop()
Deprecated.Stop the scanning.boolean
exists(java.lang.String path)
Deprecated.java.io.FilenameFilter
getFilenameFilter()
Deprecated.boolean
getRecursive()
Deprecated.boolean
getReportDirs()
Deprecated.boolean
getReportExistingFilesOnStartup()
Deprecated.int
getScanDepth()
Deprecated.Get the scanDepth.java.util.List<java.io.File>
getScanDirs()
Deprecated.int
getScanInterval()
Deprecated.Get the scan intervaljava.util.Set<java.nio.file.Path>
getScannables()
Deprecated.java.util.Timer
newTimer()
Deprecated.java.util.TimerTask
newTimerTask()
Deprecated.void
removeListener(Scanner.Listener listener)
Deprecated.Remove a registered listenervoid
reset()
Deprecated.Clear the list of scannables.void
scan()
Deprecated.Perform a pass of the scanner and report changesvoid
scanFiles()
Deprecated.Scan all of the given paths.void
schedule()
Deprecated.void
setFilenameFilter(java.io.FilenameFilter filter)
Deprecated.void
setRecursive(boolean recursive)
Deprecated.void
setReportDirs(boolean dirs)
Deprecated.Set if found directories should be reported.void
setReportExistingFilesOnStartup(boolean reportExisting)
Deprecated.Whether or not an initial scan will report all files as being added.void
setScanDepth(int scanDepth)
Deprecated.Set the scanDepth.void
setScanDirs(java.util.List<java.io.File> dirs)
Deprecated.void
setScanInterval(int scanInterval)
Deprecated.Set the scan interval-
Methods 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 Detail
-
DEFAULT_SCAN_DEPTH
public static final int DEFAULT_SCAN_DEPTH
Deprecated.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:
FileVisitor.preVisitDirectory(java.nio.file.Path, java.nio.file.attribute.BasicFileAttributes)
, Constant Field Values
-
MAX_SCAN_DEPTH
public static final int MAX_SCAN_DEPTH
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public void setScanDirs(java.util.List<java.io.File> dirs)
Deprecated.
-
addScanDir
@Deprecated public void addScanDir(java.io.File dir)
Deprecated.
-
addFile
public void addFile(java.nio.file.Path p) throws java.io.IOException
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:
java.io.IOException
-
addDirectory
public IncludeExcludeSet<java.nio.file.PathMatcher,java.nio.file.Path> addDirectory(java.nio.file.Path p) throws java.io.IOException
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:
java.io.IOException
-
getScanDirs
@Deprecated public java.util.List<java.io.File> getScanDirs()
Deprecated.
-
getScannables
public java.util.Set<java.nio.file.Path> getScannables()
Deprecated.
-
setRecursive
@Deprecated public void setRecursive(boolean recursive)
Deprecated.- Parameters:
recursive
- True if scanning is recursive- See Also:
setScanDepth(int)
-
getRecursive
@Deprecated public boolean getRecursive()
Deprecated.- Returns:
- True if scanning is recursive
- See Also:
getScanDepth()
-
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 public void setFilenameFilter(java.io.FilenameFilter filter)
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 public java.io.FilenameFilter 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
public void addListener(Scanner.Listener listener)
Deprecated.Add an added/removed/changed listener- Parameters:
listener
- the listener to add
-
removeListener
public void removeListener(Scanner.Listener listener)
Deprecated.Remove a registered listener- Parameters:
listener
- the Listener to be removed
-
doStart
public void doStart()
Deprecated.Start the scanning action.
-
newTimerTask
public java.util.TimerTask newTimerTask()
Deprecated.
-
newTimer
public java.util.Timer 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
public boolean exists(java.lang.String path)
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.
-
-