Class MultiResourceFinder

Direct Known Subclasses:
LazyMultiResourceFinder

public class MultiResourceFinder extends ListableResourceFinder
A ResourceFinder that finds its resources through a collection of other ResourceFinders.
  • Field Details

  • Constructor Details

    • MultiResourceFinder

      public MultiResourceFinder(Iterable<? extends ResourceFinder> resourceFinders)
      Parameters:
      resourceFinders - The entries of the "path"
    • MultiResourceFinder

      public MultiResourceFinder(ResourceFinder... resourceFinders)
      Parameters:
      resourceFinders - The entries of the "path"
  • Method Details

    • findResource

      @Nullable public final Resource findResource(String resourceName)
      Description copied from class: ResourceFinder
      Finds a resource by name and return it as a Resource object.
      Specified by:
      findResource in class ResourceFinder
      Parameters:
      resourceName - Designates the resource; typically structured by slashes ("/") like "com/foo/pkg/Bar.class"
      Returns:
      null if the resource could not be found
    • list

      @Nullable public Iterable<Resource> list(String resourceNamePrefix, boolean recurse) throws IOException
      Specified by:
      list in class ListableResourceFinder
      Parameters:
      resourceNamePrefix - E.g. "" or "java/lang"
      Returns:
      All resources who's name starts with the given prefix; null iff a location designated by the resourceNamePrefix does not exist
      Throws:
      IOException