| |
|
| java.lang.Object de.finix.contelligent.ComponentPath
All known Subclasses: de.finix.contelligent.GlobalComponentPath,
Constructor Summary | |
public | ComponentPath(String path) Creates a ComponentPath from the given path. | public | ComponentPath(String path, boolean validatePath) Creates a ComponentPath from the given path. |
SEPARATOR | final public static char SEPARATOR(Code) | | the separator for path-elements
|
SEPARATOR_STRING | final public static String SEPARATOR_STRING(Code) | | |
VCSIZE_COMPPATH | final public static int VCSIZE_COMPPATH(Code) | | |
VCSIZE_DIR | final public static int VCSIZE_DIR(Code) | | |
VCSIZE_NAME | final public static int VCSIZE_NAME(Code) | | |
log | final static org.apache.log4j.Logger log(Code) | | |
pathpathWithEndTokendirname | final String pathpathWithEndTokendirname(Code) | | |
permittedNameCharacters | final public static String permittedNameCharacters(Code) | | |
permittedPathCharacters | final public static String permittedPathCharacters(Code) | | |
ComponentPath | public ComponentPath(String path)(Code) | | Creates a ComponentPath from the given path. The given
path must contain at least one character!
|
ComponentPath | public ComponentPath(String path, boolean validatePath)(Code) | | Creates a ComponentPath from the given path. If parameter
validatePath is true the path gets
ComponentPath.validatePath validated before parsing.
|
calculateLargestCommonPath | public static ComponentPath calculateLargestCommonPath(ComponentPath[] paths)(Code) | | Returns the largest common path among the given paths. If an error occurs
or if any of the paths is relative or if the paths have no path in common
the
ComponentPath.ROOT_PATH is returned.
Parameters: paths - a ComponentPath[] value a ComponentPath value |
exchangeParent | public ComponentPath exchangeParent(ComponentPath oldParent, ComponentPath newParent)(Code) | | Returns a path where the given oldParent is exchanged with
newParent or null if this path is not a
ComponentPath.isSubPathOf sub-path of oldParent.
Parameters: oldParent - a ComponentPath value Parameters: newParent - a ComponentPath value a ComponentPath value |
getParsedPath | public String[] getParsedPath()(Code) | | Returns a String[] containing the elements of this path.
See
parsePath(String) for further description.
a String[] value containing the path elements oran empty String[] if this path is empty. |
getPathWithEndToken | public String getPathWithEndToken()(Code) | | |
hashCode | public int hashCode()(Code) | | |
isAbsolute | public boolean isAbsolute()(Code) | | |
isAbsolutePath | public static boolean isAbsolutePath(String path)(Code) | | Returns true if the given path begins with a
ComponentPath.SEPARATOR .
Parameters: path - a String value a boolean value |
isDotDotRelative | public boolean isDotDotRelative()(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | Returns true if this path is null or has length zero.
a boolean value |
isRelative | public boolean isRelative()(Code) | | |
isRoot | public boolean isRoot()(Code) | | |
isSubPathOf | public static boolean isSubPathOf(String subPath, String path)(Code) | | Returns true if subPath is a sub-path of path by
means of path-elements. For example '/my/path2/sub' is a sub-path of
'/my/path2' but '/my/path' is not. Note that two equal paths are not
sub-paths of one another and that both path to check must be absolute!
Parameters: subPath - a non-empty String , the absolute path to checkwhether it is a sub-path. Parameters: path - a non-empty String , the absolute path to checksubPath against a boolean value |
isSubPathOf | public boolean isSubPathOf(ComponentPath path)(Code) | | Returns true if this path is a sub-path of path by means of
path-elements. For example '/my/path2/sub' is a sub-path of '/my/path2'
but '/my/path' is not. Note that two equal paths are not
sub-paths of one another and that both path to check must be absolute!
Parameters: path - the path to check this path against. a boolean value |
parsePath | public static String[] parsePath(String path) throws ComponentPathException(Code) | | Returns a String[] containing the elements of the given
path which are determined by means of a
ComponentPath.SEPARATOR separator .
The path doesn't need to start or end with a separator, so with the
default separator '/' either of "/sub/text", "sub/text", "/sub/text/" or
"sub/text/" will result in two path elements 'sub' and 'text'.
Note that multiple separator sequences like "///" will be merged into a
single separator.
Parameters: path - a non-empty String value containg the path toparse. a String[] value containing the path elements oran empty String[] if the path was empty. |
validatePath | public static String validatePath(String path)(Code) | | FIXME: this method currently doesn't do anything!
Validates the given path (and should throw exception if path is invalid).
Validating a path means the following:
- check whether the length of the path exceeds maximum
- check whether path contains any forbidden characters
- removeType leading or trailing whitespaces from path
- merge multiple occurances of separators into one
- MAYBE: call normalize on path that is removeType sequences of a
path-element followed by '..'
|
valueOf | public static PropertyType valueOf(String s) throws PropertyException(Code) | | Returns a new ComponentPath object initialized to the
value of the specified String.
Parameters: s - a String value a PropertyType value |
|
|
|