sdt.mediator
Class PropertyLoader

java.lang.Object
  extended by sdt.mediator.PropertyLoader

public abstract class PropertyLoader
extends java.lang.Object

PropetyLoader \brief Helper to load property files taken off of the web \author John Letourneau


Constructor Summary
PropertyLoader()
           
 
Method Summary
static java.util.Properties loadProperties(java.lang.String name)
          A convenience overload of loadProperties(String, ClassLoader) that uses the current thread's context classloader.
static java.util.Properties loadProperties(java.lang.String name, java.lang.ClassLoader loader)
          Looks up a resource named 'name' in the classpath.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyLoader

public PropertyLoader()
Method Detail

loadProperties

public static java.util.Properties loadProperties(java.lang.String name,
                                                  java.lang.ClassLoader loader)
Looks up a resource named 'name' in the classpath. The resource must map to a file with .properties extention. The name is assumed to be absolute and can use either "/" or "." for package segment separation with an optional leading "/" and optional ".properties" suffix. Thus, the following names refer to the same resource:
 some.pkg.Resource
 some.pkg.Resource.properties
 some/pkg/Resource
 some/pkg/Resource.properties
 /some/pkg/Resource
 /some/pkg/Resource.properties
 

Parameters:
name - classpath resource name [may not be null]
loader - classloader through which to load the resource [null is equivalent to the application loader]
Returns:
resource converted to java.util.Properties [may be null if the resource was not found and THROW_ON_LOAD_FAILURE is false]
Throws:
java.lang.IllegalArgumentException - if the resource was not found and THROW_ON_LOAD_FAILURE is true

loadProperties

public static java.util.Properties loadProperties(java.lang.String name)
A convenience overload of loadProperties(String, ClassLoader) that uses the current thread's context classloader.