use of org.codehaus.plexus.resource.loader.ResourceLoader in project maven-plugins by apache.
the class LicenseResourceManager method getResource.
@Override
public PlexusResource getResource(String name) throws ResourceNotFoundException {
for (ResourceLoader resourceLoader : resourceLoaders.values()) {
if (resourceLoader instanceof ThreadContextClasspathResourceLoader && !"config/maven-header.txt".equals(name)) {
// classloader, only allow config/maven-header.txt
continue;
}
try {
PlexusResource resource = resourceLoader.getResource(name);
getLogger().debug("The resource '" + name + "' was found as " + resource.getName() + ".");
return resource;
} catch (ResourceNotFoundException e) {
getLogger().debug("The resource '" + name + "' was not found with resourceLoader " + resourceLoader.getClass().getName() + ".");
}
}
throw new ResourceNotFoundException(name);
}
use of org.codehaus.plexus.resource.loader.ResourceLoader in project maven-plugins by apache.
the class LicenseResourceManager method addSearchPath.
@Override
public void addSearchPath(String id, String path) {
ResourceLoader loader = (ResourceLoader) resourceLoaders.get(id);
if (loader == null) {
throw new IllegalArgumentException("unknown resource loader: " + id);
}
loader.addSearchPath(path);
}
Aggregations