org.apache.maven.wagon

Class PathUtils


public class PathUtils
extends java.lang.Object

Various path (URL) manipulation routines
Version:
$Id: PathUtils.java 165261 2005-04-29 04:50:40Z brett $
Author:
Michal Maczka

Method Summary

static String
basedir(String url)
static String
dirname(String path)
Returns the directory path portion of a file specification string.
static String[]
dirnames(String path)
static String
filename(String path)
Returns the filename portion of a file specification string.
static String
host(String url)
Return the host name (Removes protocol and path from the URL) E.g: for input http://www.codehause.org this method will return www.apache.org
static String
password(String url)
static int
port(String url)
static String
protocol(String url)
/** Return the protocol name.
static String
toRelative(File basedir, String absolutePath)
static String
user(String url)

Method Details

basedir

public static String basedir(String url)
Parameters:
url -
Returns:

dirname

public static String dirname(String path)
Returns the directory path portion of a file specification string. Matches the equally named unix command.
Returns:
The directory portion excluding the ending file separator.

dirnames

public static String[] dirnames(String path)

filename

public static String filename(String path)
Returns the filename portion of a file specification string.
Returns:
The filename string with extension.

host

public static String host(String url)
Return the host name (Removes protocol and path from the URL) E.g: for input http://www.codehause.org this method will return www.apache.org
Parameters:
url - the url
Returns:
the host name

password

public static String password(String url)

port

public static int port(String url)
Parameters:
url -
Returns:

protocol

public static String protocol(String url)
/** Return the protocol name.
E.g: for input http://www.codehause.org this method will return http
Parameters:
url - the url
Returns:
the host name

toRelative

public static String toRelative(File basedir,
                                String absolutePath)

user

public static String user(String url)