Top Description Fields Constructors Methods
org.codehaus.commons.compiler.util.resource

public abstract Class ListableResourceFinder

extends ResourceFinder
Class Inheritance
Known Direct Subclasses
org.codehaus.commons.compiler.util.resource.MapResourceFinder, org.codehaus.commons.compiler.util.resource.MultiResourceFinder, org.codehaus.commons.compiler.util.resource.FileResourceFinder
Imports
java.io.IOException, org.codehaus.commons.nullanalysis.Nullable

Extends the ResourceFinder class with a list(String, boolean) method.

Field Summary

Inherited from org.codehaus.commons.compiler.util.resource.ResourceFinder:
EMPTY_RESOURCE_FINDER

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract Iterable<Resource>

Returns:

All resources who's name starts with the given prefix; null iff a location designated by the resourceNamePrefix does not exist
list
(String
E.g. "" or "java/lang/"
resourceNamePrefix
,
boolean recurse)

Returns all resources who's names start with a given string.

Inherited from org.codehaus.commons.compiler.util.resource.ResourceFinder:
findResourcefindResourceAsStream

Constructor Detail

ListableResourceFinderback to summary
public ListableResourceFinder()

Method Detail

listback to summary
public abstract Iterable<Resource> list(String resourceNamePrefix, boolean recurse) throws IOException

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
Parameters
resourceNamePrefix:String

E.g. "" or "java/lang/"

Returns:Iterable<Resource>

All resources who's name starts with the given prefix; null iff a location designated by the resourceNamePrefix does not exist

Annotations
@Nullable