gov.lanl.Utility
Class ResourceNameTranslate

java.lang.Object
  |
  +--gov.lanl.Utility.ResourceNameTranslate

public class ResourceNameTranslate
extends java.lang.Object

This class converts a String representation of a ResourceNameComponent into the appropriate structure and vice versa. This is particularly useful for mapping String names into the RAD space. e.g. Id.10001/field.BACTERIOLOGY maps to a ResourceNameComponent array of two elements. The element before the period is the name_string and the element after the period is the value_string This follows the specification for Stringified NameComponents as specified in the updated NamingService This seems appropriate because the ResourceNameComponent was borrowed from that specification.

Version:
$Id: ResourceNameTranslate.java,v 1.5 2002/04/25 23:09:18 dwforslund Exp $
Author:
$Author: dwforslund $

Method Summary
static boolean isValid(java.lang.String resource)
          Check to see if Resource string is a valid ResourceName
static ResourceNameComponent[] toName(java.lang.String resourceName)
          function to turn string into a ResourceNameComponent array The characters '.', '/' and '\' can be included in the string values if they are preceded with '\'
static ResourceName toResource(java.lang.String resource)
          Convert resourceName string into a full resourceName
static java.lang.String toString(ResourceName resource)
          Extend convention to handle resource name prepend the authority as though it were a protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isValid

public static boolean isValid(java.lang.String resource)
Check to see if Resource string is a valid ResourceName

Parameters:
resource - string containing the ResourceName
Returns:
boolean result of test

toString

public static java.lang.String toString(ResourceName resource)
Extend convention to handle resource name prepend the authority as though it were a protocol.

Parameters:
resource - ResourceName to be stringified
Returns:
String representation of input ResourceName

toResource

public static ResourceName toResource(java.lang.String resource)
                               throws InvalidResourceName
Convert resourceName string into a full resourceName

Parameters:
resource - string with the full resourceName
Returns:
ResourceName
InvalidResourceName

toName

public static ResourceNameComponent[] toName(java.lang.String resourceName)
                                      throws InvalidResourceName
function to turn string into a ResourceNameComponent array The characters '.', '/' and '\' can be included in the string values if they are preceded with '\'

Parameters:
resourceName - to be converted to ResourceNameComponent
Returns:
ResourceNameComponent[]
InvalidResourceName


Copyright © 2000 Apache Software Foundation. All Rights Reserved.