public class PathUtils extends Object
Constructor and Description |
---|
PathUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getAbsolutePath(String workingDir,
String path)
Returns a string representation of the specified path, resolved against
the working directory, if it isn't absolute.
|
static String |
getFileNameFromPath(String path)
Strips the directory path from a file or dir name, returning just
the trailing prefix/filename from a path.
|
static boolean |
isAbsolute(String path)
Returns true if the specified path is absolute.
|
static String[] |
splitRootFromAbsolutePath(String path)
Splits an absolute path into an absolute root directory and a path
relative to that root directory.
|
static String |
stripFilenameFromPath(String path)
Removes the trailing prefix/filename from a path, returning
just the directory path.
|
public static String getAbsolutePath(String workingDir, String path)
workingDir
- Working dir specified for the component.path
- The path to resolve.public static String stripFilenameFromPath(String path)
path
- Path whose trailing filename will be removed.public static String getFileNameFromPath(String path)
path
- Path from which to retrieve the filename.public static boolean isAbsolute(String path)
path
- Path to test.public static String[] splitRootFromAbsolutePath(String path)
path
- Path to split.Copyright © 2014, Oracle and/or its affiliates. All rights reserved.