public class ResourceLoader extends Object
getResourceStream(String)
getResourceURL(String)
TODO currently uses classpath for loading resources. We should provide later capability to load
resources from httpxx and other methods and protocols.Modifier and Type | Class and Description |
---|---|
static class |
ResourceLoader.SchemaProperties
This class encapsulates schema file properties: InputStream, and full path ( including host
IP or name )
|
Constructor and Description |
---|
ResourceLoader() |
Modifier and Type | Method and Description |
---|---|
static InputStream |
findClusterXML(String _clusterXML)
Look for the requested cluster XML file in the ResourceBundle (classpath) under
|
static InputStream |
findClusterXSLSchema(InputStream _clusterXMLInputStream)
Using the _clusterMembersStream InputStream, we parse the DOM and fetch the value of the
|
static InputStream |
findClusterXSLSchema(String _clusterXSLSchema)
Look for the requested cluster XSL schema file in the ResourceBundle (classpath) under
|
static InputStream |
findConfigDCache(String fileName) |
static InputStream |
findContainerSchema(String schemaName) |
static InputStream |
findContainerSchema(String schemaName,
boolean createIfNotExists)
Look for the requested container schema file in the ResourceBundle (classpath) under
|
static URL |
findContainerXML(String _containerName)
Look for the requested container xml file in the classpath (resource) under
|
static Properties |
findCustomPropertiesObj(String schemaPropertiesFileName)
Used to load xxx.properties file, parse it and create a Properties object out of it.
|
static InputStream |
findJMSConfig(String customConfigFileName)
Find in classpath jms-config file.
|
static ResourceLoader.SchemaProperties |
findSpaceSchema(String _schemaName)
Look for the requested space schema file in the ResourceBundle (classpath) under
|
static String[] |
getClusterSchemas()
Returns an array of strings naming the schemas in the default ${com.gs.home}/config/schemas
directory.
|
static String[] |
getClusterSchemas(File schemasDir)
Returns an array of strings naming the schemas in the specified directory.
|
static InputStream |
getResourceStream(String name)
Several attempts to search for the requested resource as an input stream:
1.
|
static InputStream |
getResourceStream(String name,
String locatorBaseDir) |
static InputStream |
getResourceStream(String name,
String locatorBaseDir,
boolean createIfNotExists)
Several attempts to search for the requested resource as an input stream:
1.
|
static URL |
getResourceURL(String name)
Loads the requested resource and returns its URL.
|
static URL |
getResourceURL(String name,
String locatorBaseDir)
Loads the requested resource and returns its URL.
|
static URL |
getServicesConfigUrl() |
static InputStream |
resolveClusterXSLSchema(String _clusterMembers)
Resolving cluster schema XSL from cluster xml.
|
public static URL getServicesConfigUrl()
public static InputStream getResourceStream(String name, String locatorBaseDir)
public static InputStream getResourceStream(String name, String locatorBaseDir, boolean createIfNotExists)
name
- name of resource to loadlocatorBaseDir
- if not null we will try to search for the resource in the file system
under the locatorBaseDir as the base search pathpublic static URL getResourceURL(String name, String locatorBaseDir)
name
- name of resource to loadlocatorBaseDir
- if not null we will try to search for the resource in the file systempublic static InputStream getResourceStream(String name)
name
- name of resource to getpublic static URL getResourceURL(String name)
name
- name of resource to getpublic static Properties findCustomPropertiesObj(String schemaPropertiesFileName) throws IOException, ConfigurationException
{@link
- ConfigurationException} in case the resource could not be loadedIOException
ConfigurationException
public static InputStream findClusterXSLSchema(InputStream _clusterXMLInputStream) throws ClusterConfigurationException
ClusterConfigurationException
- if the requested cluster schema was not foundpublic static InputStream resolveClusterXSLSchema(String _clusterMembers) throws ClusterConfigurationException
ClusterConfigurationException
- if the requested cluster schema was not foundpublic static InputStream findClusterXML(String _clusterXML)
public static InputStream findClusterXSLSchema(String _clusterXSLSchema) throws ClusterConfigurationException
ClusterConfigurationException
- if the requested cluster schema was not foundpublic static InputStream findContainerSchema(String schemaName)
public static InputStream findContainerSchema(String schemaName, boolean createIfNotExists)
public static InputStream findConfigDCache(String fileName)
public static InputStream findJMSConfig(String customConfigFileName) throws Exception
customConfigFileName
- e.g. myFile-jms-config.xml which is been looked under
config/jms/Exception
public static ResourceLoader.SchemaProperties findSpaceSchema(String _schemaName) throws ConfigurationException
ConfigurationException
NOTE that the ConfigurationException
- in case the requested resource could not be foundpublic static URL findContainerXML(String _containerName)
public static String[] getClusterSchemas()
Copyright © GigaSpaces.