Package org.apache.maven.wagon
Class PathUtils
java.lang.Object
org.apache.maven.wagon.PathUtils
Various path (URL) manipulation routines
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static String
authorization
(String url) This was changed from private to package local so that it can be unit tested.static String
Derive the path portion of the given URL.private static String
Decodes the specified (portion of a) URL.static String
Returns the directory path portion of a file specification string.static String[]
private static int
endOfHostPosition
(String host, int pos) static String
Returns the filename portion of a file specification string.static String
Return the host name (Removes protocol and path from the URL) E.g: for inputhttp://www.codehause.org
this method will returnwww.apache.org
static String
static int
static String
/** Return the protocol name.private static String[]
static String
toRelative
(File basedir, String absolutePath) static String
-
Constructor Details
-
PathUtils
private PathUtils()
-
-
Method Details
-
dirname
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
Returns the filename portion of a file specification string.- Returns:
- The filename string with extension.
-
dirnames
-
split
-
host
Return the host name (Removes protocol and path from the URL) E.g: for inputhttp://www.codehause.org
this method will returnwww.apache.org
- Parameters:
url
- the url- Returns:
- the host name
-
authorization
This was changed from private to package local so that it can be unit tested. -
endOfHostPosition
-
protocol
/** Return the protocol name.
E.g: for inputhttp://www.codehause.org
this method will returnhttp
- Parameters:
url
- the url- Returns:
- the host name
-
port
- Parameters:
url
-- Returns:
- the port or
WagonConstants.UNKNOWN_PORT
if not existent
-
basedir
Derive the path portion of the given URL.- Parameters:
url
- the repository URL- Returns:
- the basedir of the repository
-
decode
Decodes the specified (portion of a) URL. Note: This decoder assumes that ISO-8859-1 is used to convert URL-encoded octets to characters.- Parameters:
url
- The URL to decode, may benull
.- Returns:
- The decoded URL or
null
if the input wasnull
.
-
user
-
password
-
toRelative
-