@Component(role=ResourceManager.class, instantiationStrategy="per-lookup") public class DefaultResourceManager extends org.codehaus.plexus.logging.AbstractLogEnabled implements ResourceManager
Modifier and Type | Field and Description |
---|---|
private java.io.File |
outputDirectory |
private java.util.Map<java.lang.String,ResourceLoader> |
resourceLoaders |
ROLE
Constructor and Description |
---|
DefaultResourceManager() |
Modifier and Type | Method and Description |
---|---|
void |
addSearchPath(java.lang.String id,
java.lang.String path) |
void |
createResourceAsFile(PlexusResource resource,
java.io.File outputFile)
Downloads the resource to the given output file.
|
PlexusResource |
getResource(java.lang.String name)
Searches for a resource with the given name.
|
java.io.File |
getResourceAsFile(PlexusResource resource)
Returns a file with the given resources contents.
|
java.io.File |
getResourceAsFile(java.lang.String name) |
java.io.File |
getResourceAsFile(java.lang.String name,
java.lang.String outputPath) |
java.io.InputStream |
getResourceAsInputStream(java.lang.String name) |
java.io.File |
resolveLocation(java.lang.String name)
Provides compatibility with the Locator utility used by several Maven Plugins.
|
java.io.File |
resolveLocation(java.lang.String name,
java.lang.String outputPath)
Provides compatibility with the Locator utility used by several Maven Plugins.
|
void |
setOutputDirectory(java.io.File outputDirectory) |
@Requirement(role=ResourceLoader.class) private java.util.Map<java.lang.String,ResourceLoader> resourceLoaders
private java.io.File outputDirectory
public java.io.InputStream getResourceAsInputStream(java.lang.String name) throws ResourceNotFoundException
getResourceAsInputStream
in interface ResourceManager
ResourceNotFoundException
public java.io.File getResourceAsFile(java.lang.String name) throws ResourceNotFoundException, FileResourceCreationException
getResourceAsFile
in interface ResourceManager
ResourceNotFoundException
FileResourceCreationException
public java.io.File getResourceAsFile(java.lang.String name, java.lang.String outputPath) throws ResourceNotFoundException, FileResourceCreationException
getResourceAsFile
in interface ResourceManager
ResourceNotFoundException
FileResourceCreationException
public java.io.File resolveLocation(java.lang.String name, java.lang.String outputPath) throws java.io.IOException
ResourceManager
resolveLocation
in interface ResourceManager
java.io.IOException
public java.io.File resolveLocation(java.lang.String name) throws java.io.IOException
ResourceManager
resolveLocation
in interface ResourceManager
java.io.IOException
public void setOutputDirectory(java.io.File outputDirectory)
setOutputDirectory
in interface ResourceManager
public void addSearchPath(java.lang.String id, java.lang.String path)
addSearchPath
in interface ResourceManager
public PlexusResource getResource(java.lang.String name) throws ResourceNotFoundException
ResourceManager
getResource
in interface ResourceManager
ResourceNotFoundException
public java.io.File getResourceAsFile(PlexusResource resource) throws FileResourceCreationException
ResourceManager
getResourceAsFile
in interface ResourceManager
FileResourceCreationException
public void createResourceAsFile(PlexusResource resource, java.io.File outputFile) throws FileResourceCreationException
ResourceManager
createResourceAsFile
in interface ResourceManager
FileResourceCreationException