Package org.codehaus.plexus.resource
Class DefaultResourceManager
java.lang.Object
org.codehaus.plexus.resource.DefaultResourceManager
- All Implemented Interfaces:
ResourceManager
- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private File
private final Map
<String, ResourceLoader> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSearchPath
(String id, String path) void
createResourceAsFile
(PlexusResource resource, File outputFile) Downloads the resource to the given output file.getResource
(String name) Searches for a resource with the given name.getResourceAsFile
(String name) getResourceAsFile
(String name, String outputPath) getResourceAsFile
(PlexusResource resource) Returns a file with the given resources contents.resolveLocation
(String name) Provides compatibility with the Locator utility used by several Maven Plugins.resolveLocation
(String name, String outputPath) Provides compatibility with the Locator utility used by several Maven Plugins.void
setOutputDirectory
(File outputDirectory)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
resourceLoaders
-
outputDirectory
-
-
Constructor Details
-
DefaultResourceManager
-
-
Method Details
-
getResourceAsInputStream
- Specified by:
getResourceAsInputStream
in interfaceResourceManager
- Throws:
ResourceNotFoundException
-
getResourceAsFile
public File getResourceAsFile(String name) throws ResourceNotFoundException, FileResourceCreationException - Specified by:
getResourceAsFile
in interfaceResourceManager
- Throws:
ResourceNotFoundException
FileResourceCreationException
-
getResourceAsFile
public File getResourceAsFile(String name, String outputPath) throws ResourceNotFoundException, FileResourceCreationException - Specified by:
getResourceAsFile
in interfaceResourceManager
- Throws:
ResourceNotFoundException
FileResourceCreationException
-
resolveLocation
Description copied from interface:ResourceManager
Provides compatibility with the Locator utility used by several Maven Plugins.- Specified by:
resolveLocation
in interfaceResourceManager
-
resolveLocation
Description copied from interface:ResourceManager
Provides compatibility with the Locator utility used by several Maven Plugins.- Specified by:
resolveLocation
in interfaceResourceManager
-
setOutputDirectory
- Specified by:
setOutputDirectory
in interfaceResourceManager
-
addSearchPath
- Specified by:
addSearchPath
in interfaceResourceManager
-
getResource
Description copied from interface:ResourceManager
Searches for a resource with the given name.- Specified by:
getResource
in interfaceResourceManager
- Throws:
ResourceNotFoundException
-
getResourceAsFile
Description copied from interface:ResourceManager
Returns a file with the given resources contents. If the resource is already available as a file, returns that file. Otherwise, a file in the resource managers output directory is created and the resource is downloaded to that file.- Specified by:
getResourceAsFile
in interfaceResourceManager
- Throws:
FileResourceCreationException
-
createResourceAsFile
public void createResourceAsFile(PlexusResource resource, File outputFile) throws FileResourceCreationException Description copied from interface:ResourceManager
Downloads the resource to the given output file.- Specified by:
createResourceAsFile
in interfaceResourceManager
- Throws:
FileResourceCreationException
-