org.apache.maven.wagon
Class PathUtils

java.lang.Object
  extended by org.apache.maven.wagon.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

Constructor Summary
PathUtils()
           
 
Method Summary
private static java.lang.String authorization(java.lang.String url)
           
static java.lang.String basedir(java.lang.String url)
           
static java.lang.String dirname(java.lang.String path)
          Returns the directory path portion of a file specification string.
static java.lang.String[] dirnames(java.lang.String path)
           
static java.lang.String filename(java.lang.String path)
          Returns the filename portion of a file specification string.
static java.lang.String host(java.lang.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 java.lang.String password(java.lang.String url)
           
static int port(java.lang.String url)
           
static java.lang.String protocol(java.lang.String url)
          /** Return the protocol name.
private static java.lang.String[] split(java.lang.String str, java.lang.String separator, int max)
           
static java.lang.String toRelative(java.io.File basedir, java.lang.String absolutePath)
           
static java.lang.String user(java.lang.String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathUtils

public PathUtils()
Method Detail

dirname

public static java.lang.String dirname(java.lang.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.

filename

public static java.lang.String filename(java.lang.String path)
Returns the filename portion of a file specification string.

Returns:
The filename string with extension.

dirnames

public static java.lang.String[] dirnames(java.lang.String path)

split

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

host

public static java.lang.String host(java.lang.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

authorization

private static java.lang.String authorization(java.lang.String url)

protocol

public static java.lang.String protocol(java.lang.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

port

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

basedir

public static java.lang.String basedir(java.lang.String url)
Parameters:
url -
Returns:

user

public static java.lang.String user(java.lang.String url)

password

public static java.lang.String password(java.lang.String url)

toRelative

public static java.lang.String toRelative(java.io.File basedir,
                                          java.lang.String absolutePath)