|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.utilities.fileio.PathSpecifier
public class PathSpecifier
Path name specifier. Allows patterns at each level of the path. For example: j*.s* matches java.encryption and javax.swing. A final * character matches all sub-packages. So java.awt.* matches all subpackages of java.awt.
Note:Here is the table of options for processing various combinations of packages from the swing hierarchy:
To keep from recognizing subpackages, specify "?*" as the last entry. The "?" is intended to reflect its usual meaning as "any character". Although the "?" pattern is not recognized in general, it's use here serves to distinguish "all subdirectories" (*) from "all directories at this level (?*).
swing
|
+---+---+
table text
|
html
match(String, String)
function. That allows a package-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,
FileSpecifier| Field Summary | |
|---|---|
protected boolean |
openEnded
Set true when the pattern to match ends with "*", as in "java.awt.*". |
protected java.util.LinkedList |
patternList
|
| Constructor Summary | |
|---|---|
PathSpecifier(java.util.List pList)
Create a specifier using a pre-separated list of directory-name patterns. |
|
PathSpecifier(java.util.List pList,
java.lang.String aSeparator)
Create a specifier using a pre-separated list of directory-name patterns, plus the separator that was used to split them apart (for use when gluing them back together with toString(). |
|
PathSpecifier(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 into directory-name patterns. |
|
PathSpecifier(java.lang.String s,
java.lang.String aSeparator)
Create a specifier using the specified directory-seperator, where the separator is used to divide the input string into directory-name patterns. |
|
| Method Summary | |
|---|---|
protected void |
initPatternList(java.util.List pList)
Initialize the list of path patterns |
boolean |
match(java.util.List testList)
Check the list of path-elements to see if it matches this specifier. |
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. |
static java.util.LinkedList |
parsePath(java.lang.String path)
Divide the string argument into directory-name patterns using the default directory-seperator for the current system. |
static java.util.LinkedList |
parsePath(java.lang.String path,
java.lang.String aSeparator)
Divide the string argument into directory-name patterns using the specified directory-seperator. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.LinkedList patternList
protected boolean openEnded
| Constructor Detail |
|---|
public PathSpecifier(java.lang.String pattern)
pattern - the pattern to match (ex: j*\s*), where
a null pattern or empty string matches everything
public PathSpecifier(java.lang.String s,
java.lang.String aSeparator)
s - the pattern to match (ex: j*\s*), where
a null pattern or empty string matches everythingaSeparator - the directory-name separator --
"/" for Unix, "\" for DOS, "." for packages.public PathSpecifier(java.util.List pList)
pList - a list of Strings
java.lang.ClassCastException - if the list entries are not strings
public PathSpecifier(java.util.List pList,
java.lang.String aSeparator)
pList - a list of StringsaSeparator - the directory-name separator
java.lang.ClassCastException - if the list entries are not strings| Method Detail |
|---|
public static java.util.LinkedList parsePath(java.lang.String path)
path - the pathname to parse
public static java.util.LinkedList parsePath(java.lang.String path,
java.lang.String aSeparator)
path - the pathname to parseaSeparator - the directory-name separator --
"/" for Unix, "\" for DOS, "." for packages.protected void initPatternList(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, where a null or empty string
matches nothing
public boolean match(java.lang.String path,
java.lang.String separator)
path - the directory-path string to match,
where a null or empty string matches nothingseparator - the directory-name separator --
"/" for Unix, "\" for DOS, "." for packages.
public boolean match(java.util.List testList)
testList - a list
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||