gov.sns.application
Class Util

java.lang.Object
  |
  +--gov.sns.application.Util

public class Util
extends java.lang.Object

Utility class providing convenience methods for use in the application framework.


Constructor Summary
protected Util()
          Creates a new instance of Util
 
Method Summary
static java.util.Map getPropertiesFromResource(java.lang.String propertyFile)
          Convenience method for loading the resource bundle from a file whose path is specified relative to the application's resources folder.
protected static java.lang.String[] getTokens(java.lang.String string)
          Parse a string into tokens where whitespace is the delimiter.
protected static java.lang.String[] getTokens(java.lang.String string, java.lang.String delim)
          Parse a string into tokens with the specified delimiter.
static java.util.Map loadResourceBundle(java.lang.String path)
          Load the resource bundle specified by the path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

protected Util()
Creates a new instance of Util

Method Detail

loadResourceBundle

public static java.util.Map loadResourceBundle(java.lang.String path)
                                        throws java.util.MissingResourceException
Load the resource bundle specified by the path. The path should be given in Java classpath notation and should exclude the "properties" suffix of the properties file. When the resource bundle is loaded, the properties are stored in a Map for convenience data access.

Parameters:
path - The path to the properties file
Returns:
The map equivalent of the resource bundle
Throws:
java.util.MissingResourceException - If the resource bundle cannot be found.

getPropertiesFromResource

public static java.util.Map getPropertiesFromResource(java.lang.String propertyFile)
                                               throws java.util.MissingResourceException
Convenience method for loading the resource bundle from a file whose path is specified relative to the application's resources folder.

Parameters:
propertyFile - The property file path relative to the application's resources folder
Returns:
The map equivalent of the resource bundle
Throws:
java.util.MissingResourceException - If the resource bundle cannot be found.
See Also:
loadResourceBundle(java.lang.String)

getTokens

protected static java.lang.String[] getTokens(java.lang.String string)
Parse a string into tokens where whitespace is the delimiter.

Parameters:
string - The string to parse.
Returns:
The array of tokens.

getTokens

protected static java.lang.String[] getTokens(java.lang.String string,
                                              java.lang.String delim)
Parse a string into tokens with the specified delimiter.

Parameters:
string - The string to parse.
delim - The delimiter
Returns:
The array of tokens.