org.apache.geronimo.kernel.repository
Class AbstractRepository

java.lang.Object
  extended by org.apache.geronimo.kernel.repository.AbstractRepository
All Implemented Interfaces:
Repository, WriteableRepository
Direct Known Subclasses:
AbstractRepository, Maven2Repository

public abstract class AbstractRepository
extends Object
implements WriteableRepository


Field Summary
protected static org.apache.commons.logging.Log log
           
protected  File rootFile
           
 
Constructor Summary
AbstractRepository(File rootFile)
           
 
Method Summary
 boolean contains(Artifact artifact)
          Checks whether this repository contains an entry for the specified artifact.
 void copyToRepository(File source, Artifact destination, FileWriteMonitor monitor)
          Copies a file from the server's filesystem into the repository.
 void copyToRepository(InputStream source, int size, Artifact destination, FileWriteMonitor monitor)
          Copies the contents of an arbitrary stream into the repository.
 LinkedHashSet<Artifact> getDependencies(Artifact artifact)
          Loads any dependencies for this artifact declared in META-INF/geronimo-dependency.xml within the configuration archive.
 void setTypeHandler(String type, ArtifactTypeHandler handler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.geronimo.kernel.repository.Repository
getLocation
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

rootFile

protected final File rootFile
Constructor Detail

AbstractRepository

public AbstractRepository(File rootFile)
Method Detail

contains

public boolean contains(Artifact artifact)
Description copied from interface: Repository
Checks whether this repository contains an entry for the specified artifact. The artifact must be fully resolved (isResolved() == true).

Specified by:
contains in interface Repository

getDependencies

public LinkedHashSet<Artifact> getDependencies(Artifact artifact)
Description copied from interface: Repository
Loads any dependencies for this artifact declared in META-INF/geronimo-dependency.xml within the configuration archive. This does not do anything special if the artifact is a configuration (which means it doesn't see dependencies in the ConfigurationData, etc.) so it's mainly useful for JAR-type artifacts.

Specified by:
getDependencies in interface Repository
Parameters:
artifact - A fully-resolved artifact representing the repository entry you're interested in.
Returns:
a LinkedHashSet (with elements of type Artifact) listing any dependencies declared in META-INF/geronimo-dependency.xml for the specified artifact.

setTypeHandler

public void setTypeHandler(String type,
                           ArtifactTypeHandler handler)

copyToRepository

public void copyToRepository(File source,
                             Artifact destination,
                             FileWriteMonitor monitor)
                      throws IOException
Description copied from interface: WriteableRepository
Copies a file from the server's filesystem into the repository. Obviously to use this remotely, you must have some other way to upload the file to the server's filesystem, even if the the server is just going to turn around and upload it to some other remote location.

Specified by:
copyToRepository in interface WriteableRepository
Parameters:
source - A file representing the data for the new repository entry
destination - A fully-resolved artifact that tells the repository where it should save the data to
monitor - Tracks the progress of the installation
Throws:
IOException

copyToRepository

public void copyToRepository(InputStream source,
                             int size,
                             Artifact destination,
                             FileWriteMonitor monitor)
                      throws IOException
Description copied from interface: WriteableRepository
Copies the contents of an arbitrary stream into the repository. Obviously to use this remotely, you must have some other way to upload the content to the server's JVM, even if the the server is just going to turn around and upload it to some other remote location. The source will be closed when the write completes.

Specified by:
copyToRepository in interface WriteableRepository
Parameters:
source - A stream representing the data for the new repository entry
destination - A fully-resolved artifact that tells the repository where it should save the data to
monitor - Tracks the progress of the installation
Throws:
IOException


Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.