org.sonatype.aether.test.util.connector
Class TestConnectorPathUtils

java.lang.Object
  extended by org.sonatype.aether.test.util.connector.TestConnectorPathUtils

public final class TestConnectorPathUtils
extends java.lang.Object

URL handling for file URLs. Based on org.apache.maven.wagon.PathUtils.

Author:
Benjamin Hanzelmann

Method Summary
static java.lang.String basedir(java.lang.String url)
          Derive the path portion of the given 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 protocol(java.lang.String url)
          Return the protocol name.
static java.lang.String toRelative(java.io.File basedir, java.lang.String absolutePath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)

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

basedir

public static java.lang.String basedir(java.lang.String url)
Derive the path portion of the given URL.

Parameters:
url - the file-repository URL
Returns:
the basedir of the repository

toRelative

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


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.