@ComponentSpecification public interface ClasspathScanner
getClasspathResource*() methods the entire classpath will be
scanned and the result will be cached. This is an expensive operation. However, after the results are
cached further invocations are relatively cheap. Please note that only the "directory structure" is kept in
cache but not any content. Invocations to read file contents from the classpath will always return the
recent data without caching. If you have a dynamic classpath where resources can be added at runtime see
clearCaches(). If you create and initialize the implementation (manually or via
Ioc) it shall not scan the classpath or build any caches before any
of the actual getClasspathResource*() methods are invoked.| Modifier and Type | Method and Description |
|---|---|
void |
clearCaches()
Evicts all cache data so that any further invocation of the other methods will rebuild the cached data
from scratch.
|
BrowsableResource |
getClasspathResource() |
BrowsableResource |
getClasspathResource(Package pkg) |
BrowsableResource |
getClasspathResource(String classpath) |
Iterable<? extends BrowsableResource> |
getClasspathResourceFiles() |
Iterable<? extends BrowsableResource> |
getClasspathResourceFiles(Filter<? super BrowsableResource> filter) |
BrowsableResource getClasspathResource()
BrowsableResource for the root (or default) package.BrowsableResource getClasspathResource(String classpath)
classpath - is the classpath location pointing to a Package or
ClasspathResource.BrowsableResource for the given classpath.BrowsableResource getClasspathResource(Package pkg)
pkg - is the Package to get.BrowsableResource pointing to the given package.Iterable<? extends BrowsableResource> getClasspathResourceFiles()
Iterable<? extends BrowsableResource> getClasspathResourceFiles(Filter<? super BrowsableResource> filter)
filter - decides which file resources to
accept. Please note that the name of the filtered resources will end with ".class" in case of a Class.Iterable with all resource files on the classpath
accepted by the given filter.void clearCaches()
Copyright © 2001–2015 mmm-Team. All rights reserved.