A special-purpose subclass of the Pattern class.
Has two different applications:
**
- any path
Usage:
PathPattern pp=new PathPattern("jregex/**"); //all files and directories
//under the jregex directory
Enumeration files=pp.enumerateFiles();
Matcher m=pp.matcher();
while(files.hasMoreElements()){
File f=(File)files.nextElement();
m.setTarget(f.getPath());
if(!m.matches()) System.out.println("Error in jregex.io.PathPattern");
}
- See Also:
WildcardPattern
, Serialized Form
Constructor Summary |
PathPattern(java.io.File dir,
java.lang.String path,
boolean icase)
|
PathPattern(java.io.File dir,
java.lang.String path,
int flags)
|
PathPattern(java.lang.String ptn)
|
PathPattern(java.lang.String ptn,
boolean icase)
|
PathPattern(java.lang.String path,
int flags)
|
Method Summary |
java.io.File |
directory()
Deprecated. Is meaningless with regard to variable paths (since v.1.2) |
java.util.Enumeration |
enumerateFiles()
|
java.io.File[] |
files()
|
java.lang.String[] |
names()
Deprecated. Is meaningless with regard to variable paths (since v.1.2) |
java.lang.String |
toString()
|
Methods inherited from class jregex.Pattern |
compile, groupCount, groupId, matcher, matcher, matcher, matcher, matcher, matcher, matches, replacer, replacer, startsWith, tokenizer, tokenizer, tokenizer, toString_d |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PathPattern
public PathPattern(java.lang.String ptn)
PathPattern
public PathPattern(java.lang.String ptn,
boolean icase)
PathPattern
public PathPattern(java.lang.String path,
int flags)
PathPattern
public PathPattern(java.io.File dir,
java.lang.String path,
boolean icase)
PathPattern
public PathPattern(java.io.File dir,
java.lang.String path,
int flags)
enumerateFiles
public java.util.Enumeration enumerateFiles()
files
public java.io.File[] files()
names
public java.lang.String[] names()
- Deprecated. Is meaningless with regard to variable paths (since v.1.2)
directory
public java.io.File directory()
- Deprecated. Is meaningless with regard to variable paths (since v.1.2)
toString
public java.lang.String toString()
- Overrides:
toString
in class Pattern