FileDocCategorySizeDatePackage
Utility.javaAPI DocJava SE 5 API2453Fri Aug 26 14:54:26 BST 2005com.sun.corba.se.impl.naming.namingutil

Utility

public class Utility extends Object
Utility methods for Naming.
Author
Hemanth

Fields Summary
private static com.sun.corba.se.impl.logging.NamingSystemException
wrapper
Constructors Summary
Methods Summary
static java.lang.StringcleanEscapes(java.lang.String stringToDecode)
cleanEscapes removes URL escapes as per IETF 2386 RFP.


                   
          
        StringWriter theStringWithoutEscape = new StringWriter();
        for( int i = 0; i < stringToDecode.length(); i++ ) {
            char c = stringToDecode.charAt( i ) ;
            if( c != '%" ) {
                theStringWithoutEscape.write( c );
            } else {
                // Get the two hexadecimal digits and convert that into int
                i++;
                int Hex1 = hexOf( stringToDecode.charAt(i) );
                i++;
                int Hex2 = hexOf( stringToDecode.charAt(i) );
                int value = (Hex1 * 16) + Hex2;
                // Convert the integer to ASCII
                theStringWithoutEscape.write( (char) value );
            }
        }
        return theStringWithoutEscape.toString();
    
static inthexOf(char x)
Converts an Ascii Character into Hexadecimal digit NOTE: THIS METHOD IS DUPLICATED TO DELIVER NAMING AS A SEPARATE COMPONENT TO RI.

        int val;

        val = x - '0";
        if (val >=0 && val <= 9)
            return val;

        val = (x - 'a") + 10;
        if (val >= 10 && val <= 15)
            return val;

        val = (x - 'A") + 10;
        if (val >= 10 && val <= 15)
            return val;

        throw new DATA_CONVERSION( );
    
static voidvalidateGIOPVersion(IIOPEndpointInfo endpointInfo)
If GIOP Version is not correct, This method throws a BAD_PARAM Exception.

        if ((endpointInfo.getMajor() > NamingConstants.MAJORNUMBER_SUPPORTED) ||
	    (endpointInfo.getMinor() > NamingConstants.MINORNUMBERMAX ) )
        {
	    throw wrapper.insBadAddress() ;
        }