Class DataSourceUrlResolver

    • Constructor Detail

      • DataSourceUrlResolver

        public DataSourceUrlResolver​(URL baseUrl)
        Constructor.
        Parameters:
        baseUrl - the base URL used for resolving relative resource locations
      • DataSourceUrlResolver

        public DataSourceUrlResolver​(URL baseUrl,
                                     boolean lenient)
        Constructor.
        Parameters:
        baseUrl - the base URL used for resolving relative resource locations
        lenient - shall we ignore resources not found or complain with an exception
    • Method Detail

      • getBaseUrl

        public URL getBaseUrl()
        Get the base URL used for resolving relative resource locations.
        Returns:
        the baseUrl
      • resolve

        public DataSource resolve​(String resourceLocation)
                           throws IOException
        Resolves the given resource location to a DataSource.
        Parameters:
        resourceLocation - the location of the resource
        Returns:
        the DataSource
        Throws:
        IOException - the resource was not found
      • resolve

        public DataSource resolve​(String resourceLocation,
                                  boolean isLenient)
                           throws IOException
        Resolves the given resource location to a DataSource.
        Parameters:
        resourceLocation - the location of the resource
        isLenient - shall we ignore resources not found or complain with an exception?
        Returns:
        the data source containing the resource or null if the resource was not found in lenient mode
        Throws:
        IOException - resolving the resource failed