Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

org.bounce.util
Class URIUtils

java.lang.Object
  extended by org.bounce.util.URIUtils

public class URIUtils
extends java.lang.Object

Put comment...

Version:
$Revision$, $Date$
Author:
Edwin Dankert

Constructor Summary
URIUtils()
           
 
Method Summary
static java.io.File composeFile(java.net.URI base, java.lang.String relativePath)
          Return the absolute path, composed from a base URI and a relative path.
static java.lang.String composePath(java.net.URI base, java.lang.String relativePath)
          Return the absolute path, composed from a base URI and a relative path.
static java.net.URI composeURI(java.net.URI base, java.lang.String relativePath)
          Return the absolute URI, composed from a base URI and a relative path.
static java.net.URI createURI(java.lang.String path)
          Creates a URI from a path, the path can be relative or absolute, '\' and '/' are normalised.
static java.lang.String getDirectoryName(java.net.URI uri)
          Returns the name of the directory that is pointed to by this URI.
static java.lang.String getExtension(java.net.URI uri)
          Returns the extension of the file that is pointed to by this URI.
static java.lang.String getName(java.net.URI uri)
          Returns the name of the file that is pointed to by this URI.
static java.lang.String getRelativePath(java.net.URI base, java.io.File file)
          Return the path for the file relative to the base uri.
static java.net.URI getRelativeURI(java.net.URI base, java.net.URI uri)
          Return the uri for the uri relative to the base uri.
static java.io.File toFile(java.net.URI uri)
          Creates a File from a URI, the URI can be relative or absolute, this method returns only a file for the Scheme Specific Part.
static java.lang.String toString(java.net.URI uri)
          Creates a String from a URI, the URI can be relative or absolute, the URI is decoded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URIUtils

public URIUtils()
Method Detail

getName

public static java.lang.String getName(java.net.URI uri)
Returns the name of the file that is pointed to by this URI.

Parameters:
uri - the uri to get the name for.
Returns:
the name of the file.

getExtension

public static java.lang.String getExtension(java.net.URI uri)
Returns the extension of the file that is pointed to by this URI.

Parameters:
uri - the uri to get the extension for.
Returns:
the extension of the file.

getDirectoryName

public static java.lang.String getDirectoryName(java.net.URI uri)
Returns the name of the directory that is pointed to by this URI.

Parameters:
uri - the uri to get the directory name for.
Returns:
the name of the directory.

createURI

public static java.net.URI createURI(java.lang.String path)
Creates a URI from a path, the path can be relative or absolute, '\' and '/' are normalised.

Parameters:
path - the path to create the URI for.
Returns:
a new URI.

toString

public static java.lang.String toString(java.net.URI uri)
Creates a String from a URI, the URI can be relative or absolute, the URI is decoded. TODO Why can't I just return uri.toString()???

Parameters:
uri - the URI to return the string representation for.
Returns:
a string representation of the URI.

toFile

public static java.io.File toFile(java.net.URI uri)
Creates a File from a URI, the URI can be relative or absolute, this method returns only a file for the Scheme Specific Part.

Parameters:
uri - the URI to create the file for.
Returns:
a new file.

getRelativeURI

public static java.net.URI getRelativeURI(java.net.URI base,
                                          java.net.URI uri)
Return the uri for the uri relative to the base uri.

Parameters:
base - the base uri.
uri - the file location to get the relative path for.
Returns:
the relative uri.

getRelativePath

public static java.lang.String getRelativePath(java.net.URI base,
                                               java.io.File file)
Return the path for the file relative to the base uri.

Parameters:
base - the base url.
file - the file location to get the relative path for.
Returns:
the relative path.

composeURI

public static java.net.URI composeURI(java.net.URI base,
                                      java.lang.String relativePath)
Return the absolute URI, composed from a base URI and a relative path.

Parameters:
base - the base uri.
relativePath - the relative path.
Returns:
the absolute URI.

composeFile

public static java.io.File composeFile(java.net.URI base,
                                       java.lang.String relativePath)
Return the absolute path, composed from a base URI and a relative path.

Parameters:
base - the base uri.
relativePath - the relative path.
Returns:
the absolute path.

composePath

public static java.lang.String composePath(java.net.URI base,
                                           java.lang.String relativePath)
Return the absolute path, composed from a base URI and a relative path.

Parameters:
base - the base uri.
relativePath - the relative path.
Returns:
the absolute path.

Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

Copyright 2002-2002-2009 Edwin Dankert. All Rights Reserved.