public class Path extends Object implements Comparable<Path>
Constructor and Description |
---|
Path(String path)
Create a new path object either from a concrete path or from a glob pattern.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Path o) |
boolean |
equals(Object obj) |
String |
getPath()
Return the path.
|
int |
hashCode() |
boolean |
matches(String otherPath)
Check whether the provided path is equal to this path or a sub path of it.
|
public Path(@Nonnull String path)
Create a new path object either from a concrete path or from a glob pattern.
A glob pattern must start with the glob:
prefix (e.g. glob:**/*.html
). The following rules are used
to interpret glob patterns:
*
character matches zero or more characters of a name component without crossing directory boundaries.**
characters match zero or more characters crossing directory boundaries.path
- the resource path or a glob pattern.public boolean matches(String otherPath)
otherPath
- Path to checktrue
If other path is within the sub tree of this path.public String getPath()
public int compareTo(@Nonnull Path o)
compareTo
in interface Comparable<Path>
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.