Class DirResourceLoader

java.lang.Object
com.tccc.kos.commons.util.resource.DirResourceLoader
All Implemented Interfaces:
ResourceLoader

public class DirResourceLoader extends Object implements ResourceLoader
Loader that searches resources on the filesystem relative to a base directory.
Since:
1.0
Version:
2023-01-22
  • Constructor Details

    • DirResourceLoader

      public DirResourceLoader(File dir)
      Create a ResourceLoader that searchs relative to the specified base directory.
      Parameters:
      dir - the base directory
  • Method Details

    • getResource

      public InputStream getResource(String file)
      Description copied from interface: ResourceLoader
      Return an input stream for the specified file.
      Specified by:
      getResource in interface ResourceLoader
      Parameters:
      file - the file to return an input stream for
      Returns:
      the input stream or null