public class PathManagerUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static @NotNull java.lang.String |
absoluteToRelative(@NotNull java.lang.String reference,
@NotNull java.lang.String absolute)
Converts an absolute path to a relative path.
|
static @NotNull java.lang.String |
getAbsolutePath(@NotNull java.lang.CharSequence path)
Returns the given path in absolute form.
|
static @NotNull java.lang.String |
getMapPath(@NotNull java.io.File file,
@NotNull java.io.File baseDir)
Returns a relative path path for a
File . |
static boolean |
isAbsolute(@NotNull java.lang.String path)
Check whether a path is absolute.
|
static boolean |
isRelative(@NotNull java.lang.String path)
Check whether a path is relative.
|
static @NotNull java.lang.String |
path(@NotNull java.lang.CharSequence str)
Creates a reasonable path.
|
static @NotNull java.lang.String |
relativeToAbsolute(@NotNull java.lang.String reference,
@NotNull java.lang.String relative)
Converts a relative path to an absolute path.
|
@NotNull public static @NotNull java.lang.String getMapPath(@NotNull @NotNull java.io.File file, @NotNull @NotNull java.io.File baseDir)
File
.file
- the filebaseDir
- the base directory to relativize againstpublic static boolean isAbsolute(@NotNull @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 @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 @NotNull java.lang.String relativeToAbsolute(@NotNull @NotNull java.lang.String reference, @NotNull @NotNull java.lang.String relative)
reference
- the reference file the relative path works onrelative
- destination file with relative path@NotNull public static @NotNull java.lang.String absoluteToRelative(@NotNull @NotNull java.lang.String reference, @NotNull @NotNull java.lang.String absolute)
reference
- the reference file the relative path works onabsolute
- destination file with relative path@NotNull public static @NotNull java.lang.String path(@NotNull @NotNull java.lang.CharSequence str)
str
- the string to create path from@NotNull public static @NotNull java.lang.String getAbsolutePath(@NotNull @NotNull java.lang.CharSequence path)
path
- the path to convert