org.codehaus.plexus.util
public class PathTool extends Object
Version: $Id: PathTool.java 1724 2005-04-17 12:40:30Z evenisse $
Method Summary | |
---|---|
static String | calculateLink(String link, String relativePath)
Calculates the appropriate link given the preferred link and the relativePath of the document |
static String | determineRelativePath(String filename, String separator)
Determines the relative path of a filename. |
static String | determineSeparator(String filename)
Helper method to determine the file separator (forward or
backward slash) used in a filename. |
static String | getDirectoryComponent(String filename)
Determines the directory component of a filename. |
static String | getRelativePath(String basedir, String filename)
Determines the relative path of a filename from a base directory.
|
static String | getRelativePath(String filename)
Determines the relative path of a filename. |
static String | uppercaseDrive(String path)
Cygwin prefers lowercase drive letters, but other parts of maven use uppercase |
Parameters: link relativePath
Returns: String
Parameters: filename The filename to parse. separator The separator used within the filename.
Returns: The relative path of the filename. This value is not terminated with a forward slash. A zero-length string is returned if: the filename is zero-length.
Parameters: filename The filename parsed to determine the file separator.
Returns: The file separator used within filename
.
This value is either a forward or backward slash.
$context.getAppValue("infilename")
to get the
current directory that is currently being processed.
This method is thread-safe.
Parameters: filename The filename to be parsed.
Returns: The directory portion of the filename
. If
the filename does not contain a directory component, "." is
returned.
$relativePath
context variable. The arguments to
this method may contain either forward or backward slashes as
file separators. The relative path returned is formed using
forward slashes as it is expected this path is to be used as a
link in a web page (again mimicking Anakia's behavior).
This method is thread-safe.
Parameters: basedir The base directory. filename The filename that is relative to the base directory.
Returns: The relative path of the filename from the base
directory. This value is not terminated with a forward slash.
A zero-length string is returned if: the filename is not relative to
the base directory, basedir
is null or zero-length,
or filename
is null or zero-length.
$relativePath
context variable. The argument to
this method may contain either forward or backward slashes as
file separators. The relative path returned is formed using
forward slashes as it is expected this path is to be used as a
link in a web page (again mimicking Anakia's behavior).
This method is thread-safe.
Parameters: filename The filename to be parsed.
Returns: The relative path of the filename. This value is not
terminated with a forward slash. A zero-length string is
returned if: filename
is null or zero-length.
Parameters: path
Returns: String