org.edg.data.util.naming
Class Canonicalizer

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

public class Canonicalizer
extends java.lang.Object

Validate guid, surl and lfn.

Version:
$Id: Canonicalizer.java,v 1.10 2004/05/18 10:33:40 jamesc Exp $
Author:
Peter Kunszt

Constructor Summary
Canonicalizer()
           
 
Method Summary
static java.lang.String guid(java.lang.String guid)
          Check whether a guid is valid
static java.net.URI guid(java.net.URI guid)
          Check whether a guid is valid
static java.lang.String lfn(java.lang.String lfn)
          Check whether an lfn is valid
static java.net.URI lfn(java.net.URI lfn)
          Check whether an lfn is valid
static java.net.URI stripGuidPrefix(java.lang.String guid)
           
static java.net.URI stripGuidPrefix(java.net.URI guid)
          For a given GUID, chech if a prefix exists: If not, return the same GUID otherwise remove the prefix "guid:"
static java.net.URI stripLfnPrefix(java.lang.String lfn)
           
static java.net.URI stripLfnPrefix(java.net.URI lfn)
          For a given LFN, chech if a prefix exists: If not, return the same LFN otherwise remove the prefix "lfn:"
static java.lang.String surl(java.lang.String surl)
          Check whether a surl is valid
static java.net.URI surl(java.net.URI surl)
          Check whether a surl is valid
static java.net.URI withGuidPrefix(java.lang.String guid)
           
static java.net.URI withGuidPrefix(java.net.URI guid)
          For a given GUID, chech if a prefix exists: If yes, return the same GUID otherwise add a "guid:" prefix.
static java.net.URI withLfnPrefix(java.lang.String lfn)
           
static java.net.URI withLfnPrefix(java.net.URI lfn)
          For a given LFN, chech if a prefix exists: If yes, return the same LFN otherwise add a "lfn:" prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Canonicalizer

public Canonicalizer()
Method Detail

guid

public static java.lang.String guid(java.lang.String guid)
                             throws InvalidFileTypeException
Check whether a guid is valid

Parameters:
guid -
Throws:
InvalidFileTypeException

guid

public static java.net.URI guid(java.net.URI guid)
                         throws InvalidFileTypeException
Check whether a guid is valid

Parameters:
guid -
Throws:
InvalidFileTypeException

surl

public static java.lang.String surl(java.lang.String surl)
                             throws InvalidFileTypeException
Check whether a surl is valid

Parameters:
surl -
Returns:
The canonical form of the SURL
Throws:
InvalidFileTypeException

surl

public static java.net.URI surl(java.net.URI surl)
                         throws InvalidFileTypeException
Check whether a surl is valid

Parameters:
surl -
Returns:
The canonical form of the SURL
Throws:
InvalidFileTypeException

lfn

public static java.lang.String lfn(java.lang.String lfn)
                            throws InvalidFileTypeException
Check whether an lfn is valid

Parameters:
lfn -
Throws:
InvalidFileTypeException

lfn

public static java.net.URI lfn(java.net.URI lfn)
                        throws InvalidFileTypeException
Check whether an lfn is valid

Parameters:
lfn -
Throws:
InvalidFileTypeException

withGuidPrefix

public static java.net.URI withGuidPrefix(java.net.URI guid)
For a given GUID, chech if a prefix exists: If yes, return the same GUID otherwise add a "guid:" prefix.

Parameters:
guid - GUID to be prefixed. This should not be null.
Returns:
prefixed GUID

withGuidPrefix

public static java.net.URI withGuidPrefix(java.lang.String guid)
                                   throws InvalidFileTypeException
InvalidFileTypeException

stripGuidPrefix

public static java.net.URI stripGuidPrefix(java.net.URI guid)
For a given GUID, chech if a prefix exists: If not, return the same GUID otherwise remove the prefix "guid:"

Parameters:
guid - GUID to be prefixed. This should not be null.
Returns:
prefixed GUID

stripGuidPrefix

public static java.net.URI stripGuidPrefix(java.lang.String guid)
                                    throws InvalidFileTypeException
InvalidFileTypeException

withLfnPrefix

public static java.net.URI withLfnPrefix(java.net.URI lfn)
For a given LFN, chech if a prefix exists: If yes, return the same LFN otherwise add a "lfn:" prefix.

Parameters:
lfn - LFN to be prefixed. This should not be null.
Returns:
prefixed LFN

withLfnPrefix

public static java.net.URI withLfnPrefix(java.lang.String lfn)
                                  throws InvalidFileTypeException
InvalidFileTypeException

stripLfnPrefix

public static java.net.URI stripLfnPrefix(java.net.URI lfn)
For a given LFN, chech if a prefix exists: If not, return the same LFN otherwise remove the prefix "lfn:"

Parameters:
lfn - LFN to be prefixed. This should not be null.
Returns:
prefixed LFN

stripLfnPrefix

public static java.net.URI stripLfnPrefix(java.lang.String lfn)
                                   throws InvalidFileTypeException
InvalidFileTypeException