|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.utilities.fileio.FileSpecifier
public class FileSpecifier
Filename specifier. Allows patterns at each level of the path. For example: d*.C*Tracker matches docutil.ClassTracker and docutil.ConstrTracker.
Note:By default, paths are assumed to be separated by the default seperator character for the current system ("/" for Unix, "\" for DOS). The path separator can also be specified, both when creating the specifier and when invoking the
A final * character in the directory-path part of the pathname matches all sub-packages. So java.awt.*.Foo* matches all files that start with "Foo" in all subpackages under java.awt. To keep from recognizing subpackages, specify "?*" as the last directory entry. The specification java.awt.?*.Foo*, therefore, matches only those classes that start with Foo that are in subpackages immediately under java.awt.
match(String, String)
function. That allows a filename specifier to be created
with a dot-separator, for example, and yet be
successfully compared to a file system pathname.
Note:
A null pattern matches everything. Thematch(java.lang.String)function always returns true. However, when a null string, is compared to any pattern, the null string always returns false. (A null string matches nothing.) When a null string is compared to a null pattern, the result is false. (The null string takes precedence.)
Specifier,
PathSpecifier| Field Summary | |
|---|---|
protected Specifier |
nameSpec
|
protected PathSpecifier |
pathSpec
|
protected java.lang.String |
pattern
|
| Constructor Summary | |
|---|---|
FileSpecifier(java.lang.String pattern)
Create a specifier using the default directory-seperator for the current system, where the separator is used to divide the input string. |
|
| Method Summary | |
|---|---|
java.lang.String |
getPattern()
|
protected void |
initSpec(java.util.List pList)
Initialize this specifier |
static void |
main(java.lang.String[] args)
main(): for testing. |
boolean |
match(java.lang.String s)
Check the string argument to see if it matches this specifier, where the default directory-seperator for the current system is used to divide the input string into directory-name segments. |
boolean |
match(java.lang.String path,
java.lang.String separator)
Check the string argument to see if it matches this specifier, where the specified seperator is used to divide the input string into directory-name segments. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected PathSpecifier pathSpec
protected Specifier nameSpec
protected java.lang.String pattern
| Constructor Detail |
|---|
public FileSpecifier(java.lang.String pattern)
pattern - the pattern to match (ex: j*\Foo*Bar)| Method Detail |
|---|
protected void initSpec(java.util.List pList)
pList - a list of Strings
java.lang.ClassCastException - if the list entries are not stringspublic boolean match(java.lang.String s)
s - the string to match
public boolean match(java.lang.String path,
java.lang.String separator)
path - the directory-path string to matchseparator - the directory-name separator --
"/" for Unix, "\" for DOS, "." for packages.
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getPattern()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||