public abstract class PropertyLoader extends Object
A simple class for loading java.util.Properties backed by .ccf files deployed as classpath resources. See individual methods for details.
The original source is from:
Modifier and Type | Method and Description |
---|---|
static Properties |
loadProperties(String name)
A convenience overload of
loadProperties(String, ClassLoader)
that uses the current thread's context classloader. |
static Properties |
loadProperties(String name,
ClassLoader loader)
Looks up a resource named 'name' in the classpath.
|
public static Properties loadProperties(String name, ClassLoader loader)
The suffix ".ccf" will be appended if it is not set. This can also handle .properties files
Thus, the following names refer to the same resource:
some.pkg.Resource some.pkg.Resource.ccf some/pkg/Resource some/pkg/Resource.ccf /some/pkg/Resource /some/pkg/Resource.ccf
name
- classpath resource name [may not be null]loader
- classloader through which to load the resource [null is
equivalent to the application loader]IllegalArgumentException
- if the resource was not found and THROW_ON_LOAD_FAILURE is
truepublic static Properties loadProperties(String name)
loadProperties(String, ClassLoader)
that uses the current thread's context classloader. A better strategy
would be to use techniques shown in
http://www.javaworld.com/javaworld/javaqa/2003-06/01-qa-0606-load.html
name
- Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.