Reality Interface Classes

com.northgateis.util
Class Util

java.lang.Object
 |
 +--com.northgateis.util.Util

public class Util
extends java.lang.Object

Utility methods with no appropriate class


Constructor Summary
Util()
           
 
Method Summary
static java.lang.Stringescape(java.lang.String str)
          Encode a Java Script escape string.
static java.util.PropertiesloadPropertyFile(java.lang.String name)
          Create a new properties class and load it with data from a property file.
static java.lang.StringlocateFile(java.lang.String name)
          Search for given file name down class path
static java.lang.StringtoHex(byte B)
          Convert byte to hex string
static java.lang.Stringunescape(java.lang.String str)
          Decode a Java Script escape() string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

loadPropertyFile

public static java.util.Properties loadPropertyFile(java.lang.String name)
 throws java.io.IOException
Create a new properties class and load it with data from a property file.

Searches for file name down class path.

See java.util.Properties class for more information.

Parameters:
name - Name of property file to load.
Throws:
java.io.IOException - file not found.


locateFile

public static java.lang.String locateFile(java.lang.String name)
 throws java.io.IOException
Search for given file name down class path
Parameters:
name - property file name
Throws:
java.io.IOException - file not found

unescape

public static java.lang.String unescape(java.lang.String str)
Decode a Java Script escape() string.

Strings passed through HTTP requests are often encoded to ensure they do not cause confusion. This is especially true of cookie values.

Java Script uses the escape() method to convert problem characters into %XX format where XX is the ASCII value of the character.

This method decodes these strings replacing the escape sequences with the original characters. It is fully Java Script escape() compatible.

Parameters:
str - Escaped input string


escape

public static java.lang.String escape(java.lang.String str)
Encode a Java Script escape string.

Strings passed through HTTP requests are often encoded to ensure they do not cause confusion. This is especially true of cookie values.

Java Script uses the escape() method to convert problem characters into %XX format where XX is the ASCII value of the character.

This method emulates the Java Script escape() method for characters that cause problems in cookie values. It is fully Java Script escape() compatible.

Parameters:
str - Plain input string


toHex

public static java.lang.String toHex(byte B)
Convert byte to hex string

Parameters:
B - byte to encode


Reality Interface Classes

Copyright (c) 2000 NEC Software Services (UK) Limited