|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.Scanner
public class Scanner
Scanner Utility for scanning a directory for added, removed and changed files and reporting these events via registered Listeners.
| 嵌套类摘要 | |
|---|---|
static interface |
Scanner.BulkListener
|
static interface |
Scanner.DiscreteListener
|
static interface |
Scanner.Listener
Listener Marker for notifications re file changes. |
static class |
Scanner.Notification
|
static interface |
Scanner.ScanCycleListener
Listener that notifies when a scan has started and when it has ended. |
static interface |
Scanner.ScanListener
|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口 |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| 字段摘要 |
|---|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段 |
|---|
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| 构造方法摘要 | |
|---|---|
Scanner()
|
|
| 方法摘要 | |
|---|---|
void |
addListener(Scanner.Listener listener)
Add an added/removed/changed listener |
void |
addScanDir(File dir)
|
void |
doStart()
Start the scanning action. |
void |
doStop()
Stop the scanning. |
FilenameFilter |
getFilenameFilter()
Get any filter applied to files in the scan dir. |
boolean |
getRecursive()
|
boolean |
getReportDirs()
|
boolean |
getReportExistingFilesOnStartup()
|
int |
getScanDepth()
Get the scanDepth. |
File |
getScanDir()
已过时。 use getScanDirs() instead |
List<File> |
getScanDirs()
|
int |
getScanInterval()
Get the scan interval |
Timer |
newTimer()
|
TimerTask |
newTimerTask()
|
void |
removeListener(Scanner.Listener listener)
Remove a registered listener |
void |
reportDifferences(Map<String,org.eclipse.jetty.util.Scanner.TimeNSize> currentScan,
Map<String,org.eclipse.jetty.util.Scanner.TimeNSize> oldScan)
Report the adds/changes/removes to the registered listeners |
void |
scan()
Perform a pass of the scanner and report changes |
void |
scanFiles()
Recursively scan all files in the designated directories. |
void |
schedule()
|
void |
setFilenameFilter(FilenameFilter filter)
Apply a filter to files found in the scan directory. |
void |
setRecursive(boolean recursive)
|
void |
setReportDirs(boolean dirs)
Set if found directories should be reported. |
void |
setReportExistingFilesOnStartup(boolean reportExisting)
Whether or not an initial scan will report all files as being added. |
void |
setScanDepth(int scanDepth)
Set the scanDepth. |
void |
setScanDir(File dir)
已过时。 use setScanDirs(List dirs) instead |
void |
setScanDirs(List<File> dirs)
|
void |
setScanInterval(int scanInterval)
Set the scan interval |
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法 |
|---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public Scanner()
| 方法详细信息 |
|---|
public int getScanInterval()
public void setScanInterval(int scanInterval)
scanInterval - pause between scans in seconds, or 0 for no scan after the initial scan.@Deprecated public void setScanDir(File dir)
dir - @Deprecated public File getScanDir()
getScanDirs() being scanned)public void setScanDirs(List<File> dirs)
public void addScanDir(File dir)
public List<File> getScanDirs()
public void setRecursive(boolean recursive)
recursive - True if scanning is recursivesetScanDepth(int)public boolean getRecursive()
getScanDepth()public int getScanDepth()
public void setScanDepth(int scanDepth)
scanDepth - the scanDepth to setpublic void setFilenameFilter(FilenameFilter filter)
filter - public FilenameFilter getFilenameFilter()
public void setReportExistingFilesOnStartup(boolean reportExisting)
reportExisting - if true, all files found on initial scan will be
reported as being added, otherwise notpublic boolean getReportExistingFilesOnStartup()
public void setReportDirs(boolean dirs)
dirs - public boolean getReportDirs()
public void addListener(Scanner.Listener listener)
listener - public void removeListener(Scanner.Listener listener)
listener - the Listener to be removedpublic void doStart()
AbstractLifeCycle 中的 doStartpublic TimerTask newTimerTask()
public Timer newTimer()
public void schedule()
public void doStop()
AbstractLifeCycle 中的 doStoppublic void scan()
public void scanFiles()
public void reportDifferences(Map<String,org.eclipse.jetty.util.Scanner.TimeNSize> currentScan,
Map<String,org.eclipse.jetty.util.Scanner.TimeNSize> oldScan)
currentScan - the info from the most recent passoldScan - info from the previous pass
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||