public class PathRelativizer extends Object
Modifier and Type | Field and Description |
---|---|
static String |
URI_SEPERATOR |
static Pattern |
URI_SEPERATOR_PATTERN |
Constructor and Description |
---|
PathRelativizer() |
Modifier and Type | Method and Description |
---|---|
static String |
normalize(String name)
Normalizes path separators to '/'.
|
static List<String> |
relativize(String base,
String target)
Creates a relative sequence of path segments by 1) removing common path segments between the base
and target, 2) using ".." to change the context from the base to the target directory, and 3) use
of the remaining portion of the target path to complete the path segments.
|
static List<String> |
relativize(URI base,
URI target)
Creates a relative sequence of path segments by 1) removing common path segments between the base
and target, 2) using ".." to change the context from the base to the target directory, and 3) use
of the remaining portion of the target path to complete the path segments.
|
static URI |
toURI(List<String> relativePath)
Converts a sequence of path segments to a relative URI.
|
public static final Pattern URI_SEPERATOR_PATTERN
public static final String URI_SEPERATOR
public static List<String> relativize(URI base, URI target)
base
- the base path to relativize fromtarget
- the target path to relativize topublic static List<String> relativize(String base, String target)
base
- the base path to relativize fromtarget
- the target path to relativize topublic static URI toURI(List<String> relativePath)
relativePath
- the path segments to base the URI onCopyright © 2020 National Institute of Standards and Technology. All rights reserved.