public class BasePath extends Object
Modifier and Type | Method and Description |
---|---|
FilePattern |
asFilePattern()
Returns the file pattern.
|
boolean |
equals(Object obj) |
String |
getPathString()
Returns the path string.
|
List<String> |
getSegments()
Returns the path segments.
|
int |
hashCode() |
static BasePath |
headOf(String path)
Extracts a base path from the given path.
|
static boolean |
isEmpty(String path)
Returns whether or not the given path is empty.
|
boolean |
isPrefixOf(BasePath other)
Returns whether or not this path is a prefix of the given path.
|
boolean |
isRoot()
Returns whether this represents the root path.
|
static BasePath |
of(String path)
Resolves the given path.
|
static Optional<BasePath> |
parse(String path)
Resolves the given path.
|
BasePath |
relativise(BasePath other)
Returns the relative path of the given path.
|
BasePath |
resolve(BasePath other)
Returns a base path that is concatenation of this and the given path.
|
FilePattern |
resolve(FilePattern pattern)
Returns a file pattern that is a sequence of this and the given pattern.
|
Optional<FilePattern> |
restOf(String path)
Extracts the rest resource pattern of the given path.
|
String |
toString() |
public static final BasePath EMPTY
public static boolean isEmpty(String path)
path
- the pathtrue
if it is emptypublic static Optional<BasePath> parse(String path)
path
- the given pathempty
if it is not a valid base pathpublic static BasePath of(String path)
path
- the given pathpublic static BasePath headOf(String path)
path
- the given pathpublic boolean isRoot()
true
if this represents the root pathpublic boolean isPrefixOf(BasePath other)
other
- the target pathtrue
if this path is a prefix of the given path, otherwise false
public Optional<FilePattern> restOf(String path)
path
- the target pathheadOf(String)
public BasePath relativise(BasePath other)
other
- the target pathpublic FilePattern resolve(FilePattern pattern)
pattern
- the target patternpublic BasePath resolve(BasePath other)
other
- the suffix pathpublic String getPathString()
public FilePattern asFilePattern()
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.