public class FilePath
extends java.lang.Object
FilePath
class provides file path manipulation
utility functions.Constructor and Description |
---|
FilePath() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
convertPath(java.lang.String path,
int direction)
Converts a fully set of pathnames to and from the native filesystem's
format to the standard JDeveloper format (Windows Format, \ and ;)
|
static java.lang.String |
getBasePath(java.lang.String absolutePath,
java.lang.String relativePath) |
static java.lang.String |
getExtension(java.lang.String path)
Gets the file extension.
|
static java.lang.String |
getFilename(java.lang.String path)
Gets the last entry in the specified path.
|
static java.lang.String |
getName(java.lang.String path)
Gets file name without its extension.
|
static java.lang.String |
getParent(java.lang.String path)
Gets the parent directory of the last entry in the specified path
|
static boolean |
isAbsolute(java.lang.String filename)
Determines whether the specified filename has an absolute file
path.
|
static java.lang.String |
makePathQualified(java.lang.String root,
java.lang.String path) |
static java.lang.String |
makePathRelative(java.lang.String root,
java.lang.String path) |
static java.lang.String |
makePathRelative(java.lang.String root,
java.lang.String path,
boolean childrenOnly) |
static java.lang.String |
makeQualified(java.lang.String root,
java.lang.String relative) |
static java.lang.String |
makeRelative(java.lang.String root,
java.lang.String path)
Get the path relative to the specified root directory.
|
static java.lang.String |
makeRelative(java.lang.String root,
java.lang.String path,
boolean childrenOnly)
Get the path relative to the specified root directory.
|
static boolean |
mayBeADirectory(java.lang.String fname)
Return true if the specified name could be a directory.
|
public static final int LOADING
public static final int SAVING
public static final boolean isAbsolute(java.lang.String filename)
filename
- the file on which to do the check.public static final java.lang.String makeQualified(java.lang.String root, java.lang.String relative)
public static final java.lang.String makeRelative(java.lang.String root, java.lang.String path)
root
- the path with respect to which the relative path is
obtained.path
- the path whose relative relationship to root is sought.public static final java.lang.String makeRelative(java.lang.String root, java.lang.String path, boolean childrenOnly)
root
- the path with respect to which the relative path is
obtained.path
- the path whose relative relationship to root is sought.childrenOnly
- indicates whether to convert the path only if it is
a child of the root.public static java.lang.String makePathQualified(java.lang.String root, java.lang.String path)
public static java.lang.String makePathRelative(java.lang.String root, java.lang.String path)
public static java.lang.String makePathRelative(java.lang.String root, java.lang.String path, boolean childrenOnly)
public static final java.lang.String getParent(java.lang.String path)
path
- a file path.public static final java.lang.String getFilename(java.lang.String path)
path
- a file path.public static final java.lang.String getExtension(java.lang.String path)
path
- a file path.public static final java.lang.String getName(java.lang.String path)
path
- a file path.public static final boolean mayBeADirectory(java.lang.String fname)
fname
- a file path.public static final java.lang.String convertPath(java.lang.String path, int direction)
the
- path to be converteddirection
- to convert. This can be one of the following:FilePath.LOADINGi
FilePath.SAVING
public static final java.lang.String getBasePath(java.lang.String absolutePath, java.lang.String relativePath)