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:
Maven2Repository

public abstract class AbstractRepository
extends Object
implements WriteableRepository

Version:
$Rev: 1391947 $ $Date: 2012-09-30 11:48:05 +0800 (Sun, 30 Sep 2012) $

Field Summary
protected  org.slf4j.Logger 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.
 File getRootFile()
           
 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 final org.slf4j.Logger 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

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

getRootFile

public File getRootFile()


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