public class PathPrefixSet extends Object
Is effectively immutable and should not be modified after initial use.
Constructor and Description |
---|
PathPrefixSet() |
PathPrefixSet(boolean mergePathPrefixes) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(PathPrefix prefix) |
int |
getSize() |
boolean |
includesDirectory(String dirPath)
Determines whether or not a directory might have resources that could be
included.
|
ResourceResolution |
includesResource(String resourceAbstractPathName)
Determines whether or not a given resource should be allowed by this path
prefix set and the corresponding filters.
|
ResourceResolution |
includesResource(String resourceAbstractPathName,
String[] parts)
Dives down the package hierarchy looking for the most specific
package that applies to this resource.
|
boolean |
mergePathPrefixes() |
String |
toString() |
Collection<PathPrefix> |
values() |
public PathPrefixSet()
public PathPrefixSet(boolean mergePathPrefixes)
public boolean add(PathPrefix prefix)
prefix
- the prefix to addtrue
if the prefix was not already in the set;
otherwise, it merged with one having the same prefix, which has
the effect of expanding the filter (the merge works as
union(includes - skips) - union(excludes)
)public int getSize()
public boolean includesDirectory(String dirPath)
ClassPathEntry
subclasses to avoid descending into directory
hierarchies that could not possibly contain resources that would be
included by includesResource(String)
dirPath
- must be a valid abstract directory name (must not be an
empty string)public ResourceResolution includesResource(String resourceAbstractPathName)
resourceAbstractPathName
- PathPrefix
if the resource matches some
specified prefix and any associated filters don't exclude it.
Otherwise, returns null. So it returns null if either no prefixes
match or the most specific prefix excludes the resource.public ResourceResolution includesResource(String resourceAbstractPathName, String[] parts)
public boolean mergePathPrefixes()
public Collection<PathPrefix> values()
Copyright © 2018. All rights reserved.