Package org.apache.tomcat.util.file
Class ConfigFileLoader
- java.lang.Object
-
- org.apache.tomcat.util.file.ConfigFileLoader
-
public class ConfigFileLoader extends java.lang.ObjectThis class is used to obtainInputStreams for configuration files from a given location String. This allows greater flexibility than these files having to be loaded directly from a file system.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.io.InputStreamgetInputStream(java.lang.String location)Deprecated.static ConfigurationSourcegetSource()Get the configured configuration source.static java.net.URIgetURI(java.lang.String location)Deprecated.static voidsetSource(ConfigurationSource source)Set the configuration source used by Tomcat to locate various configuration resources.
-
-
-
Method Detail
-
getSource
public static final ConfigurationSource getSource()
Get the configured configuration source. If none has been configured, a default source based on the JVM working directory will be used.- Returns:
- the configuration source in use
-
setSource
public static final void setSource(ConfigurationSource source)
Set the configuration source used by Tomcat to locate various configuration resources. Only the first call has an effect; subsequent calls are ignored.- Parameters:
source- The source
-
getInputStream
@Deprecated public static java.io.InputStream getInputStream(java.lang.String location) throws java.io.IOExceptionDeprecated.Load the resource from the specified location.- Parameters:
location- The location for the resource of interest. The location may be a URL or a file path. Relative paths will be resolved against CATALINA_BASE.- Returns:
- The InputStream for the given resource. The caller is responsible for closing this stream when it is no longer used.
- Throws:
java.io.IOException- If an InputStream cannot be created using the provided location
-
getURI
@Deprecated public static java.net.URI getURI(java.lang.String location)
Deprecated.
-
-