Class FileResourceLoader<S>

  • Type Parameters:
    S - Type of the data to load
    All Implemented Interfaces:
    ResourceLoader<S>

    public abstract class FileResourceLoader<S>
    extends AbstractResourceLoader<S>
    This class allow to define a resource loader for files.
    Since:
    2.0
    Author:
    Laurent Jourdren
    • Constructor Detail

      • FileResourceLoader

        public FileResourceLoader​(Class<S> clazz,
                                  DataFile resourcePath)
        Public constructor.
        Parameters:
        clazz - the Class type of the resource to load @param resourcePath the path to the resource to load
    • Method Detail

      • getExtension

        protected abstract String getExtension()
        Get the extension of the files to load.
        Returns:
        the extension of the files to load
      • reload

        public void reload()
        Description copied from interface: ResourceLoader
        Reload the list of available resources.
      • addResourcePaths

        public void addResourcePaths​(Collection<String> resourcePaths)
        Add a resource paths.
        Parameters:
        resourcePaths - the resource path to add
      • addResourcePath

        public void addResourcePath​(DataFile resourcePath)
        Add a resource path.
        Parameters:
        resourcePath - the resource path to add
      • removeResourcePath

        public boolean removeResourcePath​(DataFile resourcePath)
        Add a resource path.
        Parameters:
        resourcePath - the resource path to remove
        Returns:
        true if the resource has been successfully removed