org.glite.data.common.helpers
Class Stripper

java.lang.Object
  extended byorg.glite.data.common.helpers.Stripper

public class Stripper
extends java.lang.Object

Class for stripping and regularising LFNs and GUIDs.


Constructor Summary
Stripper()
           
 
Method Summary
static java.lang.String regulariseClientDN(java.lang.String clientDN)
          Regularise a ClientDN.
static java.lang.String regulariseGUID(java.lang.String guidin, boolean validate)
          Regularise a GUID.
static java.lang.String regulariseLFN(java.lang.String lfn)
          LFN output must be of form "/path/path/filename" Allowable input forms are: /path/path/filename, //path/path/filename, etc lfn:/path/path/filename lfn://path/path/filename, lfn:///path/path/filename, etc In general: all multiple /'s are changed to a single "/"; the prefix "lfn:" is removed; "/./" is resolved to "/"; "path1/path2/../" is resolved to "path1/"; the trailing "/" is always removed if it exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stripper

public Stripper()
Method Detail

regulariseLFN

public static java.lang.String regulariseLFN(java.lang.String lfn)
                                      throws java.lang.IllegalArgumentException
LFN output must be of form "/path/path/filename" Allowable input forms are: In general: all multiple /'s are changed to a single "/"; the prefix "lfn:" is removed; "/./" is resolved to "/"; "path1/path2/../" is resolved to "path1/"; the trailing "/" is always removed if it exists.

Parameters:
lfn -
Returns:
the stripped LFN
Throws:
java.lang.IllegalArgumentException - in case of malformed LFN

regulariseGUID

public static java.lang.String regulariseGUID(java.lang.String guidin,
                                              boolean validate)
                                       throws java.lang.IllegalArgumentException
Regularise a GUID. Removes the "guid:" prefix. Sets up lowercase. Validates the guid if requested.

Parameters:
guidin - - the GUID to regularise
validate - if true, the GUID is validated using Jug.
Returns:
Throws:
java.lang.IllegalArgumentException - if the GUID was bad

regulariseClientDN

public static java.lang.String regulariseClientDN(java.lang.String clientDN)
                                           throws java.lang.IllegalArgumentException
Regularise a ClientDN. Removes the "/CN=proxy" prefix.

Returns:
Throws:
java.lang.IllegalArgumentException - if the GUID was bad