Class AbstractResourceLoader<S>

    • Constructor Detail

      • AbstractResourceLoader

        public AbstractResourceLoader()
    • Method Detail

      • getResourceAsStream

        protected abstract InputStream getResourceAsStream​(String resourcePath)
                                                    throws IOException
        Get the input stream related to a resource.
        Parameters:
        resourcePath - resource path
        Returns:
        a resource object
        Throws:
        IOException - if an error occurs while creating the input stream
      • getResourceName

        protected abstract String getResourceName​(S resource)
        Get the resource name.
        Parameters:
        resource - the resource
        Returns:
        the name of the resource
      • addResource

        protected void addResource​(String resourceName,
                                   String resourcePath)
        Add a resource.
        Parameters:
        resourceName - resource name
        resourcePath - resource path
      • loadResources

        public List<S> loadResources​(String resourceName)
        Description copied from interface: ResourceLoader
        Load a resource.
        Specified by:
        loadResources in interface ResourceLoader<S>
        Parameters:
        resourceName - name of the resource to load
        Returns:
        a list the loaded resources that had the requested name