|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rundeck.storage.api.PathUtil
public class PathUtil
Utility methods for paths
Nested Class Summary | |
---|---|
static class |
PathUtil.PathImpl
|
Field Summary | |
---|---|
static Path |
ROOT
|
static java.lang.String |
SEPARATOR
|
Constructor Summary | |
---|---|
PathUtil()
|
Method Summary | ||
---|---|---|
static PathSelector |
allpathSelector()
|
|
static
|
allResourceSelector()
A resource selector which always matches |
|
static Path |
appendPath(Path prefix,
java.lang.String subpath)
Append one path to another |
|
static java.lang.String |
appendPath(java.lang.String prefixPath,
java.lang.String subpath)
Append one path to another |
|
static Path |
asPath(java.lang.String path)
|
|
static java.lang.String |
cleanPath(java.lang.String path)
Clean the path string by removing leading and trailing slashes and removing duplicate slashes. |
|
static
|
composeSelector(ResourceSelector<T> a,
ResourceSelector<T> b,
boolean and)
compose two selectors |
|
static
|
exactMetadataResourceSelector(java.util.Map<java.lang.String,java.lang.String> required,
boolean requireAll)
A resource selector which requires metadata values to be equal to some required strings |
|
static boolean |
hasRoot(Path path,
Path root)
Return true if the given path starts with the given root |
|
static boolean |
hasRoot(java.lang.String path,
java.lang.String root)
Return true if the given path starts with the given root |
|
static boolean |
isRoot(Path path)
Return true if the path is the root |
|
static boolean |
isRoot(java.lang.String path)
Return true if the path is the root |
|
static Path |
parentPath(Path path)
|
|
static java.lang.String |
parentPathString(java.lang.String path)
Return the string representing the parent of the given path |
|
static Path |
pathFromComponents(java.lang.String[] components)
create a path from an array of components |
|
static java.lang.String |
pathName(java.lang.String path)
|
|
static java.lang.String |
pathStringFromComponents(java.lang.String[] components)
create a path from an array of components |
|
static
|
regexMetadataResourceSelector(java.util.Map<java.lang.String,java.lang.String> required,
boolean requireAll)
A resource selector which requires metadata values to match regexes |
|
static java.lang.String |
removePrefix(java.lang.String rootPath,
java.lang.String extpath)
|
|
static
|
resourceSelector(java.lang.String selector)
Return a ResourceSelector constructed using this selector syntax: |
|
static PathSelector |
subpathSelector(Path rootPath)
A Path selector that matches the given root path and any resource below it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SEPARATOR
public static final Path ROOT
Constructor Detail |
---|
public PathUtil()
Method Detail |
---|
public static Path asPath(java.lang.String path)
public static Path pathFromComponents(java.lang.String[] components)
components
-
public static java.lang.String pathStringFromComponents(java.lang.String[] components)
components
-
public static boolean hasRoot(Path path, Path root)
path
- root
-
public static boolean hasRoot(java.lang.String path, java.lang.String root)
path
- root
-
public static Path parentPath(Path path)
public static boolean isRoot(java.lang.String path)
path
-
public static boolean isRoot(Path path)
path
-
public static java.lang.String parentPathString(java.lang.String path)
path
- path string
public static java.lang.String cleanPath(java.lang.String path)
path
- input path
public static java.lang.String pathName(java.lang.String path)
public static java.lang.String removePrefix(java.lang.String rootPath, java.lang.String extpath)
public static Path appendPath(Path prefix, java.lang.String subpath)
prefix
- prefixsubpath
- sub path
public static java.lang.String appendPath(java.lang.String prefixPath, java.lang.String subpath)
prefixPath
- prefixsubpath
- sub path
public static PathSelector subpathSelector(Path rootPath)
rootPath
-
public static PathSelector allpathSelector()
public static <T extends ContentMeta> ResourceSelector<T> exactMetadataResourceSelector(java.util.Map<java.lang.String,java.lang.String> required, boolean requireAll)
T
- content typerequired
- required metadata stringsrequireAll
- if true, require all values are equal, otherwise require one value to be equal
public static <T extends ContentMeta> ResourceSelector<T> regexMetadataResourceSelector(java.util.Map<java.lang.String,java.lang.String> required, boolean requireAll)
T
- content typerequired
- required metadata regexesrequireAll
- if true, require all values match regexes, otherwise require one value to match the regex
public static <T extends ContentMeta> ResourceSelector<T> composeSelector(ResourceSelector<T> a, ResourceSelector<T> b, boolean and)
T
- a
- b
- and
- true indicates AND, otherwise OR
public static <T extends ContentMeta> ResourceSelector<T> allResourceSelector()
T
- content type
public static <T extends ContentMeta> ResourceSelector<T> resourceSelector(java.lang.String selector)
ResourceSelector
constructed using this selector syntax:key OP value [; key OP value]*OP can be "=" (exact match) or "=~" (regular expression match).
allResourceSelector()
selector
- the selector syntax string to parse, not null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |