|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--net.larsan.urd.util.fileset.FileSet
|
+--net.larsan.urd.util.fileset.RegexpFileSet
|
+--net.larsan.urd.util.fileset.WatchedFileSet
This file set is a RegexpFileSet that implements the WatchableFileSet interface.
this class uses a java.util.Timer to regulary scan the set for changes, this timer can be provided
by the controlling class in order to minimize the use of thread when having multiple file sets.
In order to control the timer threads this class should be started and stopped.
This files set recurses through subfolders by default and is synchronized.
This class does not support signed resources.
| Field Summary |
| Fields inherited from class net.larsan.urd.util.fileset.RegexpFileSet |
resources |
| Fields inherited from class net.larsan.urd.util.fileset.FileSet |
root |
| Constructor Summary | |
WatchedFileSet(java.io.File root)
Contruct the file without a regular expression or without an external timer. |
|
WatchedFileSet(java.io.File root,
java.lang.String regexp)
Contruct the file set using a regular expression but without an external timer. |
|
WatchedFileSet(java.io.File root,
java.lang.String regexp,
java.util.Timer timer)
Contruct the file set using a regular expression and an external timer. |
|
| Method Summary | |
void |
addFileSetListener(FileSetListener listener)
Register file set listener. |
void |
removeFileSetListener(FileSetListener listener)
De-register file set listener |
void |
start(long interval)
Start watching this file set. |
void |
stop()
Stop watcing this file set. |
| Methods inherited from class net.larsan.urd.util.fileset.RegexpFileSet |
getCertificates, getResource, getResourcePaths, scan |
| Methods inherited from class net.larsan.urd.util.fileset.FileSet |
getErrorHandler, isRecursive, matches, resolvePath, setErrorHandler, setIsRecursive, setRegexpPattern |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public WatchedFileSet(java.io.File root,
java.lang.String regexp,
java.util.Timer timer)
throws java.io.IOException,
java.util.regex.PatternSyntaxException
IOException
will be thrown if the root folder does not exists (or is a file) and a PatternSyntaxException if the
regular expression is invalid.
root - File set root folder, must existtimer - Timer to use for re-scans
java.io.IOException - If the file set root does not exist, or is a file
java.util.regex.PatternSyntaxException - If the regular expression is not valid
public WatchedFileSet(java.io.File root,
java.lang.String regexp)
throws java.io.IOException,
java.util.regex.PatternSyntaxException
IOException
will be thrown if the root folder does not exists (or is a file) and a PatternSyntaxException if the
regular expression is invalid.
root - File set root folder, must exist
java.io.IOException - If the file set root does not exist, or is a file
java.util.regex.PatternSyntaxException - If the regular expression is not valid
public WatchedFileSet(java.io.File root)
throws java.io.IOException
IOException
will be thrown if the root folder does not exists (or is a file).
root - File set root folder, must exist
java.io.IOException - If the file set root does not exist, or is a file| Method Detail |
public void start(long interval)
interval - Interval in milliseconds between file set checks, must be bigger than 0public void stop()
public void addFileSetListener(FileSetListener listener)
addFileSetListener in interface WatchableFileSetlistener - File set listener to addpublic void removeFileSetListener(FileSetListener listener)
removeFileSetListener in interface WatchableFileSetlistener - File set listener to remove
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||