Interface ResourceLoader


public interface ResourceLoader
  • Method Summary

    Modifier and Type
    Method
    Description
    getResource(String path, Class<?> parent)
    Finds the resource with the given name relative to the given parent class or to the root if the parent is null.
    getResourceAsStream(String path, Class<?> parent)
    Finds the resource with the given name relative to the given parent class or to the root if the parent is null.
    Finds all resources with the given name.
  • Method Details

    • getResource

      URL getResource(String path, Class<?> parent)
      Finds the resource with the given name relative to the given parent class or to the root if the parent is null.
      Parameters:
      path - The resource name
      parent - Optional parent class
      Returns:
      The resource URL or null if not found
    • getResourceAsStream

      InputStream getResourceAsStream(String path, Class<?> parent)
      Finds the resource with the given name relative to the given parent class or to the root if the parent is null.
      Parameters:
      path - The resource name
      parent - Optional parent class
      Returns:
      An input stream to the resource or null if not found
    • getResources

      Enumeration<URL> getResources(String path) throws IOException
      Finds all resources with the given name.
      Parameters:
      path - The resource name
      Returns:
      An enumeration of URL objects for the resource. If no resources could be found, the enumeration will be empty.
      Throws:
      IOException - If I/O errors occur
      IOException