Interface ResourceLoader


public interface ResourceLoader

An object able to load certain kinds of Resources.

  • Method Details

    • getId

      String getId()
    • getDescription

      String getDescription()
    • canLoad

      boolean canLoad(URI target)

      Tests if this ResourceLoader is able to load the target resource.

      Parameters:
      target - URI of resource to load
      Returns:
      true if loader can load target
    • load

      Resource load(URI target) throws ResourceLoadingException

      Get a Resource representing the target resource.

      This operation is not expected to be expensive. For example fetching remote of remote resources should be deferred until Resource#getResourceStream() is called.

      If possible there should be tests to confirm that remote resources do exist and can be accessed.

      Parameters:
      target - URI of resource to load
      Returns:
      resource
      Throws:
      ResourceLoadingException