|
||||||||||
| 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
A file set that filters it's scan operation using a regular expression pattern. The pattern is provided in the constructor of this class and cannot be changed afterwards. This file only operates on flat files and will not attempt to open arcives.
This class is recursive by default.
This class is synchronized.
This class does not support signed resources.
| Field Summary | |
protected java.util.HashMap |
resources
Hash map of path strings mapped to resources. |
| Fields inherited from class net.larsan.urd.util.fileset.FileSet |
root |
| Constructor Summary | |
RegexpFileSet(java.io.File root)
Construct a file set using a root but without a regular expression. |
|
RegexpFileSet(java.io.File root,
java.lang.String regexp)
Construct a file set using a root folder and a regular expression. |
|
| Method Summary | |
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 |
scan()
Perform a new scan of available files for the 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
| Constructor Detail |
public RegexpFileSet(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 existregexp - Perl 5 regular expression to filter file set resources with
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 RegexpFileSet(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 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||