org.edg.data.util.naming
Class URIFactory

java.lang.Object
  |
  +--org.edg.data.util.naming.URIFactory

public final class URIFactory
extends java.lang.Object

Create SURLs

Version:
$ Id:$
Author:
James Casey

Constructor Summary
protected URIFactory()
          we never construct one of these
 
Method Summary
static java.net.URI make(java.lang.String uri)
           
static java.net.URI makeFileURI(java.lang.String path)
          given a path on disk, make a file URI from it.
static java.net.URI makeGuid(java.lang.String guid)
           
static java.net.URI makeHostURI(java.lang.String hostname)
           
static java.net.URI makeLfn(java.lang.String lfn)
           
static java.net.URI makeLogical(java.lang.String uri)
           
static java.net.URI makePhysical(java.lang.String uri)
           
static java.net.URI makeSfn(java.lang.String hostname, java.lang.String path)
          Create a new SFN Surl, provided with a hostname, and a path on that host.
static java.net.URI makeSurl(java.lang.String hostname)
          Create a new Surl, provided with only a hostname.
static java.net.URI makeSurl(java.lang.String hostname, int port, java.lang.String path)
          Create a new Surl, provided with a hostname, port and a path on that host.
static java.net.URI makeSurl(java.lang.String hostname, java.lang.String path)
          Create a new Surl, provided with a hostname, and a path on that host.
static java.net.URI makeTurl(java.lang.String turl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URIFactory

protected URIFactory()
we never construct one of these

Method Detail

make

public static java.net.URI make(java.lang.String uri)
                         throws java.net.URISyntaxException
java.net.URISyntaxException

makePhysical

public static java.net.URI makePhysical(java.lang.String uri)
                                 throws java.net.URISyntaxException
java.net.URISyntaxException

makeLogical

public static java.net.URI makeLogical(java.lang.String uri)
                                throws java.net.URISyntaxException
java.net.URISyntaxException

makeLfn

public static java.net.URI makeLfn(java.lang.String lfn)
                            throws java.net.URISyntaxException
java.net.URISyntaxException

makeGuid

public static java.net.URI makeGuid(java.lang.String guid)
                             throws java.net.URISyntaxException
java.net.URISyntaxException

makeSfn

public static java.net.URI makeSfn(java.lang.String hostname,
                                   java.lang.String path)
                            throws java.net.URISyntaxException
Create a new SFN Surl, provided with a hostname, and a path on that host. The hostname should not be null. The path may be null. If it is not null, it must be an absolute path, i.e. should start with a leading '/'.

Parameters:
hostname - the host
path - the path on the host.
Returns:
the SURL as a URI
Throws:
java.net.URISyntaxException - if the hostname was null, or an invalid hostname or the path does not begin with a leading slash

makeSurl

public static java.net.URI makeSurl(java.lang.String hostname)
                             throws java.net.URISyntaxException
Create a new Surl, provided with only a hostname. The hostname should not be null.

Parameters:
hostname - the host
Returns:
the SURL as a URI
Throws:
java.net.URISyntaxException - if the hostname was null, or an invalid hostname

makeSurl

public static java.net.URI makeSurl(java.lang.String hostname,
                                    java.lang.String path)
                             throws java.net.URISyntaxException
Create a new Surl, provided with a hostname, and a path on that host. The hostname should not be null. The path may be null. If it is not null, it must be an absolute path, i.e. should start with a leading '/'.

Parameters:
hostname - the host
path - the path on the host.
Returns:
the SURL as a URI
Throws:
java.net.URISyntaxException - if the hostname was null, or an invalid hostname or the path does not begin with a leading slash

makeSurl

public static java.net.URI makeSurl(java.lang.String hostname,
                                    int port,
                                    java.lang.String path)
                             throws java.net.URISyntaxException
Create a new Surl, provided with a hostname, port and a path on that host. The hostname should not be null. The path may be null. If it is not null, it must be an absolute path, i.e. should start with a leading '/'.

Parameters:
hostname - the host
port -
path - the path on the host.
Returns:
the SURL as a URI
Throws:
java.net.URISyntaxException - if the hostname was null, or an invalid hostname or the path does not begin with a leading slash

makeFileURI

public static java.net.URI makeFileURI(java.lang.String path)
                                throws java.net.URISyntaxException
given a path on disk, make a file URI from it. If the path is relative, it will be converted to being absolute. Returns null if path is null.

Parameters:
path - the path
Returns:
A file URI representing the path
java.net.URISyntaxException

makeHostURI

public static java.net.URI makeHostURI(java.lang.String hostname)
                                throws java.net.URISyntaxException
java.net.URISyntaxException

makeTurl

public static java.net.URI makeTurl(java.lang.String turl)
                             throws java.net.URISyntaxException
java.net.URISyntaxException