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 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SEPARATOR
private static java.lang.String SEPARATOR
cat
private static org.apache.log4j.Logger cat
ResourceNameTranslate
private ResourceNameTranslate()
- Creates a new instance of ResourceNameTranslate
isValid
public static boolean isValid(java.lang.String resource)
- Check to see if Resource string is a valid ResourceName
toString
public static java.lang.String toString(org.omg.DfResourceAccessDecision.ResourceName resource)
- Extend convention to handle resource name
prepend the authority as though it were a protocol.
toResource
public static org.omg.DfResourceAccessDecision.ResourceName toResource(java.lang.String resource)
throws org.omg.DfResourceAccessDecision.InvalidResourceName
- Convert resourceName string into a full resourceName
toString
public static java.lang.String toString(org.omg.DfResourceAccessDecision.ResourceNameComponent[] ResourceNameComponentList)
- Convert ResourceNameComponent[] into a String
It will quote any literal '.', '/', and '\' characters by adding a preceding '\'
toName
public static org.omg.DfResourceAccessDecision.ResourceNameComponent[] toName(java.lang.String resourceName)
throws org.omg.DfResourceAccessDecision.InvalidResourceName
- function to turn string into a ResourceNameComponent array
The characters '.', '/' and '\' can be included in the string values if they are preceded with '\'
main
static void main(java.lang.String[] argv)
- Static test of translation