Class ConfigFileLoader


  • public class ConfigFileLoader
    extends java.lang.Object
    This class is used to obtain InputStreams 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 
      Modifier and Type Method Description
      static java.io.InputStream getInputStream​(java.lang.String location)
      Load the resource from the specified location.
      static java.net.URI getURI​(java.lang.String location)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInputStream

        public static java.io.InputStream getInputStream​(java.lang.String location)
                                                  throws java.io.IOException
        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

        public static java.net.URI getURI​(java.lang.String location)