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 Details

  • Constructor Details

    • DefaultConfigurationResourceLoader

      public DefaultConfigurationResourceLoader()
  • Method Details

    • getStream

      @Nonnull public InputStream getStream(@Nonnull String location) throws IOException
      Gets an InputStream for the resource. Supports file:, http:, https: and classpath: prefixes. For location 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 interface ConfigurationResourceLoader
      Parameters:
      location - resource location
      Returns:
      an InputStream
      Throws:
      IOException - for failures to open the stream