org.codehaus.plexus.resource
Interface ResourceManager

All Known Implementing Classes:
DefaultResourceManager

public interface ResourceManager

Version:
$Id: ResourceManager.java 7981 2008-12-28 11:08:32Z bentmann $
Author:
Trygve Laugstøl, Jason van Zyl

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 void addSearchPath(java.lang.String resourceLoaderId, java.lang.String searchPath)
           
 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 outputFile)
           
 java.io.InputStream getResourceAsInputStream(java.lang.String name)
           
 java.io.File resolveLocation(java.lang.String location)
          Deprecated.  
 java.io.File resolveLocation(java.lang.String location, java.lang.String localfile)
          Deprecated.  
 void setOutputDirectory(java.io.File outputDirectory)
           
 

Field Detail

ROLE

static final java.lang.String ROLE
Method Detail

getResourceAsInputStream

java.io.InputStream getResourceAsInputStream(java.lang.String name)
                                             throws ResourceNotFoundException
Throws:
ResourceNotFoundException

getResourceAsFile

java.io.File getResourceAsFile(java.lang.String name)
                               throws ResourceNotFoundException,
                                      FileResourceCreationException
Throws:
ResourceNotFoundException
FileResourceCreationException

getResourceAsFile

java.io.File getResourceAsFile(java.lang.String name,
                               java.lang.String outputFile)
                               throws ResourceNotFoundException,
                                      FileResourceCreationException
Throws:
ResourceNotFoundException
FileResourceCreationException

setOutputDirectory

void setOutputDirectory(java.io.File outputDirectory)

addSearchPath

void addSearchPath(java.lang.String resourceLoaderId,
                   java.lang.String searchPath)

resolveLocation

java.io.File resolveLocation(java.lang.String location,
                             java.lang.String localfile)
                             throws java.io.IOException
Deprecated. 

Provides compatibility with the Locator utility used by several Maven Plugins.

Throws:
java.io.IOException

resolveLocation

java.io.File resolveLocation(java.lang.String location)
                             throws java.io.IOException
Deprecated. 

Provides compatibility with the Locator utility used by several Maven Plugins.

Throws:
java.io.IOException

getResource

PlexusResource getResource(java.lang.String name)
                           throws ResourceNotFoundException
Searches for a resource with the given name.

Throws:
ResourceNotFoundException
Since:
1.0-alpha-5

getResourceAsFile

java.io.File getResourceAsFile(PlexusResource resource)
                               throws FileResourceCreationException
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.

Throws:
FileResourceCreationException
Since:
1.0-alpha-5

createResourceAsFile

void createResourceAsFile(PlexusResource resource,
                          java.io.File outputFile)
                          throws FileResourceCreationException
Downloads the resource to the given output file.

Throws:
FileResourceCreationException
Since:
1.0-alpha-5


Copyright © 2001-2011 Codehaus. All Rights Reserved.