public class PathManagerUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
absoluteToRelative(java.lang.String reference,
java.lang.String absolute)
Converts an absolute path to a relative path.
|
static java.lang.String |
getAbsolutePath(java.lang.CharSequence path)
Returns the given path in absolute form.
|
static java.lang.String |
getMapPath(java.io.File file,
java.io.File baseDir)
Returns a relative path path for a
File . |
static boolean |
isAbsolute(java.lang.String path)
Check whether a path is absolute.
|
static boolean |
isRelative(java.lang.String path)
Check whether a path is relative.
|
static java.lang.String |
path(java.lang.CharSequence str)
Create a reasonable path.
|
static java.lang.String |
relativeToAbsolute(java.lang.String reference,
java.lang.String relative)
Converts a relative path to an absolute path.
|
@NotNull public static java.lang.String getMapPath(@NotNull java.io.File file, @NotNull java.io.File baseDir)
File
.file
- the filebaseDir
- the base directory to relativize againstpublic static boolean isAbsolute(@NotNull java.lang.String path)
path
- the path to checktrue
if path
is absolute, false
otherwisewhich nearly is the opposite of this method
public static boolean isRelative(@NotNull java.lang.String path)
path
- the path to checktrue
if path
is relative, false
otherwisewhich nearly is the opposite of this method
@NotNull public static java.lang.String relativeToAbsolute(@NotNull java.lang.String reference, @NotNull java.lang.String relative)
reference
- the reference file the relative path works onrelative
- destination file with relative path@NotNull public static java.lang.String absoluteToRelative(@NotNull java.lang.String reference, @NotNull java.lang.String absolute)
reference
- the reference file the relative path works onabsolute
- destination file with relative path@NotNull public static java.lang.String path(@NotNull java.lang.CharSequence str)
str
- the string to create path from@NotNull public static java.lang.String getAbsolutePath(@NotNull java.lang.CharSequence path)
path
- the path to convert