org.codehaus.plexus.resource
Class DefaultResourceManager
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.codehaus.plexus.resource.DefaultResourceManager
- All Implemented Interfaces:
- org.codehaus.plexus.logging.LogEnabled, ResourceManager
public class DefaultResourceManager
- extends org.codehaus.plexus.logging.AbstractLogEnabled
- implements ResourceManager
- Version:
- $Id: DefaultResourceManager.java 8647 2010-02-15 00:08:07Z olamy $
- Author:
- Trygve Laugstøl, Jason van Zyl
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultResourceManager
public DefaultResourceManager()
getResourceAsInputStream
public java.io.InputStream getResourceAsInputStream(java.lang.String name)
throws ResourceNotFoundException
- Specified by:
getResourceAsInputStream
in interface ResourceManager
- Throws:
ResourceNotFoundException
getResourceAsFile
public java.io.File getResourceAsFile(java.lang.String name)
throws ResourceNotFoundException,
FileResourceCreationException
- Specified by:
getResourceAsFile
in interface ResourceManager
- Throws:
ResourceNotFoundException
FileResourceCreationException
getResourceAsFile
public java.io.File getResourceAsFile(java.lang.String name,
java.lang.String outputPath)
throws ResourceNotFoundException,
FileResourceCreationException
- Specified by:
getResourceAsFile
in interface ResourceManager
- Throws:
ResourceNotFoundException
FileResourceCreationException
resolveLocation
public java.io.File resolveLocation(java.lang.String name,
java.lang.String outputPath)
throws java.io.IOException
- Description copied from interface:
ResourceManager
- Provides compatibility with the Locator utility used by several Maven Plugins.
- Specified by:
resolveLocation
in interface ResourceManager
- Throws:
java.io.IOException
resolveLocation
public java.io.File resolveLocation(java.lang.String name)
throws java.io.IOException
- Description copied from interface:
ResourceManager
- Provides compatibility with the Locator utility used by several Maven Plugins.
- Specified by:
resolveLocation
in interface ResourceManager
- Throws:
java.io.IOException
setOutputDirectory
public void setOutputDirectory(java.io.File outputDirectory)
- Specified by:
setOutputDirectory
in interface ResourceManager
addSearchPath
public void addSearchPath(java.lang.String id,
java.lang.String path)
- Specified by:
addSearchPath
in interface ResourceManager
getResource
public PlexusResource getResource(java.lang.String name)
throws ResourceNotFoundException
- Description copied from interface:
ResourceManager
- Searches for a resource with the given name.
- Specified by:
getResource
in interface ResourceManager
- Throws:
ResourceNotFoundException
getResourceAsFile
public java.io.File getResourceAsFile(PlexusResource resource)
throws FileResourceCreationException
- 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 interface ResourceManager
- Throws:
FileResourceCreationException
createResourceAsFile
public void createResourceAsFile(PlexusResource resource,
java.io.File outputFile)
throws FileResourceCreationException
- Description copied from interface:
ResourceManager
- Downloads the resource to the given output file.
- Specified by:
createResourceAsFile
in interface ResourceManager
- Throws:
FileResourceCreationException
Copyright © 2001-2011 Codehaus. All Rights Reserved.