Class DefaultConfigurationResourceLoader
java.lang.Object
se.swedenconnect.security.credential.config.DefaultConfigurationResourceLoader
- All Implemented Interfaces:
ConfigurationResourceLoader
public class DefaultConfigurationResourceLoader
extends Object
implements ConfigurationResourceLoader
An implementation of
ConfigurationResourceLoader
that supports file:
, http:
, https:
and classpath:
prefixes.- Author:
- Martin Lindström
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
CLASSPATH_PREFIX
Prefix for classpath resources.- See Also:
-
HTTP_PREFIX
Prefix for HTTP URL resources.- See Also:
-
HTTPS_PREFIX
Prefix for HTTPS URL resources.- See Also:
-
FILE_PREFIX
Prefix for file resources.- See Also:
-
-
Constructor Details
-
DefaultConfigurationResourceLoader
public DefaultConfigurationResourceLoader()
-
-
Method Details
-
getStream
Gets anInputStream
for the resource. Supportsfile:
,http:
,https:
andclasspath:
prefixes. Forlocation
strings that does not begin with a prefix, the following rules apply:- If the string starts with a "/", it is assumed to be a file resource with a full path.
- If the string starts with a ".", it is assumed to be a file resource with a relative path.
- If the string does not start with a "/", it is assumed that it is a classpath resource.
- Specified by:
getStream
in interfaceConfigurationResourceLoader
- Parameters:
location
- resource location- Returns:
- an
InputStream
- Throws:
IOException
- for failures to open the stream
-