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 Object

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

Author:
Benjamin Hanzelmann

Method Summary
static String basedir(String url)
          Derive the path portion of the given 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 protocol(String url)
          Return the protocol name.
static String toRelative(File basedir, 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 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.

filename

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

Returns:
The filename string with extension.

dirnames

public static String[] dirnames(String path)

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

basedir

public static String basedir(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 String toRelative(File basedir,
                                String absolutePath)


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