19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.sun.corba.se.impl.naming.namingutil;
27
28 import java.io.StringWriter;
29
30 import org.omg.CORBA.DATA_CONVERSION;
31 import org.omg.CORBA.CompletionStatus;
32
33 import com.sun.corba.se.impl.logging.NamingSystemException;
34 import com.sun.corba.se.spi.logging.CORBALogDomains;
35
36 /**
37 * Utility methods for Naming.
38 *
39 * @Author Hemanth
40 */
41 class Utility {
42 private static NamingSystemException wrapper =
43 NamingSystemException.get( CORBALogDomains.NAMING ) ;
44
45 /**
46 * cleanEscapes removes URL escapes as per IETF 2386 RFP.
47 */
48 static String cleanEscapes( String stringToDecode ) {
49 StringWriter theStringWithoutEscape = new StringWriter();
50 for( int i = 0; i < stringToDecode.length(); i++ ) {
51 char c = stringToDecode.charAt( i ) ;
52 if( c != '%' ) {
53 theStringWithoutEscape.write( c );
54 } else {
55 // Get the two hexadecimal digits and convert that into int
56 i++;
57 int Hex1 = hexOf( stringToDecode.charAt(i) );
58 i++;
59 int Hex2 = hexOf( stringToDecode.charAt(i) );
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.sun.corba.se.impl.naming.namingutil;
27
28 import java.io.StringWriter;
29
30 import org.omg.CORBA.DATA_CONVERSION;
31 import org.omg.CORBA.CompletionStatus;
32
33 import com.sun.corba.se.impl.logging.NamingSystemException;
34 import com.sun.corba.se.spi.logging.CORBALogDomains;
35
36 /**
37 * Utility methods for Naming.
38 *
39 * @author Hemanth
40 */
41 class Utility {
42 private static NamingSystemException wrapper =
43 NamingSystemException.get( CORBALogDomains.NAMING ) ;
44
45 /**
46 * cleanEscapes removes URL escapes as per IETF 2386 RFP.
47 */
48 static String cleanEscapes( String stringToDecode ) {
49 StringWriter theStringWithoutEscape = new StringWriter();
50 for( int i = 0; i < stringToDecode.length(); i++ ) {
51 char c = stringToDecode.charAt( i ) ;
52 if( c != '%' ) {
53 theStringWithoutEscape.write( c );
54 } else {
55 // Get the two hexadecimal digits and convert that into int
56 i++;
57 int Hex1 = hexOf( stringToDecode.charAt(i) );
58 i++;
59 int Hex2 = hexOf( stringToDecode.charAt(i) );
|