Class MultiResourceFinder

    • Constructor Detail

      • MultiResourceFinder

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

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

      • findResource

        @Nullable
        public final Resource findResource​(java.lang.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 java.lang.Iterable<Resource> list​(java.lang.String resourceNamePrefix,
                                                 boolean recurse)
                                          throws java.io.IOException
        Description copied from class: ListableResourceFinder
        Returns all resources who's names start with a given string. Only resources with a content are included, no "special entries" of any kind, e.g. directories.

        If the prefix string ends with "/", you will get a proper directory listing (recurse=false) or directory tree (recurse=true). Example:

           resourceFinder.list("dir/", true) =>
             dir/
             dir/afile
             dir/bfile
             dir/adir/
             dir/adir/file
             dir/bdir/
             dir/bdir/file
         

        Otherwise, you will get a strange subset of a directory listing, resp. directory tree, as follows:

           resourceFinder.list("dir/a", true) =>
             dir/afile
             dir/adir/
             dir/adir/file
         
        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:
        java.io.IOException