public abstract class BootstrapResourceUtils extends Object
The utility methods provided in this class are meant to be used throughout the CCS environment to load resources in the Bootstrap environment.
For a description on how to control the Bootstrap environment please refer to the following manual.
| Constructor and Description |
|---|
BootstrapResourceUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Properties |
getBootstrapProperties(String fileName,
boolean includeSystem)
Utility function to fetch Properties in the Bootstrap environment.
|
static Properties |
getBootstrapProperties(String fileName,
boolean includeSystem,
Class clazz)
Utility function to fetch Properties in the Bootstrap environment.
|
static Properties |
getBootstrapProperties(String fileName,
boolean includeSystem,
ClassLoader classLoader)
Utility function to fetch Properties in the Bootstrap environment.
|
static InputStream |
getBootstrapPropertiesInputStream(String fileName,
boolean includeSystem,
Class clazz)
Get an InputStream corresponding to the Bootstrap Properties object.
|
static InputStream |
getBootstrapResource(String resourceName)
Utility functions to look for resources (excluding Properties) in the Bootstrap environment.
|
static InputStream |
getBootstrapResource(String resourceName,
Class clazz)
Utility functions to look for resources (excluding Properties) in the Bootstrap environment.
|
static InputStream |
getBootstrapResource(String resourceName,
ClassLoader classLoader)
Utility functions to look for resources (excluding properties)
in the Bootstrap environment.
|
static Properties |
getBootstrapSystemProperties()
Return the Bootstrap System Properties object.
|
public static Properties getBootstrapSystemProperties()
This function builds a Properties object by searching and chaining properties according to the following search criteria
public static Properties getBootstrapProperties(String fileName, boolean includeSystem, Class clazz)
This function builds a Properties object by searching and chaining properties according to the following search criteria
fileName - The name of the properties file to load. This can be a path.includeSystem - If true System Properties are chained after the classpath search.clazz - The class on which getResourceAsStream is invoked for the classpath search. If null BootstrapResourceUtils.class is used.public static Properties getBootstrapProperties(String fileName, boolean includeSystem)
This function is similar to getBootstrapProperties(java.lang.String, boolean, java.lang.Class).
In this case the Class object is set to null and it defaults to BootstrapResourceUtils.class.
fileName - The name of the properties file to load. This can be a path.includeSystem - If true System Properties are chained after the classpath search.getBootstrapProperties(java.lang.String, boolean, java.lang.Class)public static Properties getBootstrapProperties(String fileName, boolean includeSystem, ClassLoader classLoader)
This function is similar to getBootstrapProperties(java.lang.String, boolean, java.lang.Class) but
for the fact that a ClassLoader is used for the Classpath search, rather than a Class.
fileName - The name of the properties file to load. This can be a path.includeSystem - If true System Properties are chained after the classpath search.classLoader - The classLoader on which getResourceAsStream is invoked for the classpath search.getBootstrapProperties(java.lang.String, boolean, java.lang.Class)public static InputStream getBootstrapPropertiesInputStream(String fileName, boolean includeSystem, Class clazz)
This function is similar to getBootstrapProperties(java.lang.String, boolean, java.lang.Class).
Rather than a Properties object it returns the InputStream corresponsing to
that Properties object. This is done by invoking Properties.store(java.io.OutputStream, java.lang.String)
on a ByteArrayOutputStream and then returning an ByteArrayInputStream.
fileName - The name of the properties file to load. This can be a path.includeSystem - If true System Properties are chained after the classpath search.clazz - The class on which getResourceAsStream is invoked for the classpath search. If null BootstrapResourceUtils.class is used.getBootstrapProperties(java.lang.String, boolean, java.lang.Class)public static InputStream getBootstrapResource(String resourceName, Class clazz)
This function will search for the desired resource following the search criteria described below. It will return an InputStream for the first resource found.
Search Criteria:
For Properties refer to {@link #getBootstrapProperties(java.lang.String, boolean,java.lang.Class).
fileName - The name of the resource. This can be a path.clazz - The class on which getResourceAsStream is invoked for the
classpath search. If null BootstrapResourceUtils.class is used.public static InputStream getBootstrapResource(String resourceName)
Internally it invokes getBootstrapResource(java.lang.String,java.lang.Class) with Class
set to BootstrapResourceUtils.class.
fileName - The name of the resource. This can be a path.getBootstrapResource(java.lang.String, java.lang.Class)public static InputStream getBootstrapResource(String resourceName, ClassLoader classLoader)
This function is similar to getBootstrapResource(java.lang.String, java.lang.Class) but
for the fact that a ClassLoader is used for the Classpath search, rather than a Class.
fileName - The name of the resource. This can be a path.classLoader - The classLoader on which getResourceAsStream is invoked for the classpath search.getBootstrapResource(java.lang.String, java.lang.Class)Copyright © 2014 LSST. All Rights Reserved.