|
||||||||||
| 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.TrivialFileSet
A trivial file set is a watched file set that only works in a single file.
| Field Summary | |
protected java.io.File |
file
File to watch |
protected java.util.HashMap |
resources
Hash set of resources, paths -> resources |
| Fields inherited from class net.larsan.urd.util.fileset.FileSet |
root |
| Constructor Summary | |
TrivialFileSet(java.io.File file,
java.util.Timer timer)
Create file set. |
|
| Method Summary | |
void |
addFileSetListener(FileSetListener listener)
Register file set listener. |
protected void |
checkScan()
Check if the file still exists or have been modified |
protected void |
doScan()
Perfom scan. |
java.security.cert.Certificate[] |
getCertificates(Resource resource)
Get the certificates for a resource. |
Resource |
getResource(java.lang.String path)
Get a resource from the set. |
java.lang.String[] |
getResourcePaths()
Get all available resources ids. |
void |
removeFileSetListener(FileSetListener listener)
De-register file set listener |
void |
scan()
Perform a new scan of available files for the set. |
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.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 |
| Field Detail |
protected java.util.HashMap resources
protected java.io.File file
| Constructor Detail |
public TrivialFileSet(java.io.File file,
java.util.Timer timer)
throws java.io.IOException
file - File to watch, must not be nulltimer - Timer to use for watching the file, may be null
java.io.IOException - If the file does not exist| Method Detail |
public void scan()
throws java.io.IOException
The string array returned contains all available resources as identified by their relative path to the file set root.
scan in class FileSetAn - IOException should the scan fail
java.io.IOException - If the scan failspublic java.lang.String[] getResourcePaths()
getResourcePaths in class FileSetpublic Resource getResource(java.lang.String path)
getResourcePaths.
getResource in interface ResourceLocatorgetResource in class FileSetpath - A relative path to the resource to get
public java.security.cert.Certificate[] getCertificates(Resource resource)
getCertificates in class FileSetresource - The resource to check for signing certificates
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
protected void doScan()
throws java.io.IOException
java.io.IOExceptionprotected void checkScan()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||