org.apache.maven.wagon

Class PathUtils

public class PathUtils extends Object

Various path (URL) manipulation routines

Version: $Id: PathUtils.java 165261 2005-04-29 04:50:40Z brett $

Author: Michal Maczka

Method Summary
static Stringauthorization(String url)
static Stringbasedir(String url)
static Stringdirname(String path)
Returns the directory path portion of a file specification string.
static String[]dirnames(String path)
static Stringfilename(String path)
Returns the filename portion of a file specification string.
static Stringhost(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 Stringpassword(String url)
static intport(String url)
static Stringprotocol(String url)
/** Return the protocol name.
static String[]split(String str, String separator, int max)
static StringtoRelative(File basedir, String absolutePath)
static Stringuser(String url)

Method Detail

authorization

private static String authorization(String url)

basedir

public static String basedir(String url)

Parameters: url

Returns:

UNKNOWN: need to URL decode for spaces?

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

split

private static String[] split(String str, String separator, int max)

toRelative

public static String toRelative(File basedir, String absolutePath)

user

public static String user(String url)