org.figure8.join.services.repository
Interface Repository

All Known Implementing Classes:
AbstractStructuredRepository, SimpleFileSystemRepository, VFSRepository

public interface Repository

This is a simple interface for storing and retrieving an Artifact within a repository. A much more elaborate design would have separate repository representation from its access or connection methods representation but it's not really the point here ... Such details are left to implementations and we can find such well designed repository access libraries (look at VFS on http://jakarta.apache.org/commons/vfs or at Wagon for Maven2 on http://maven.apache.org).
Implementations or wrapper around existing libraries may choose to use the Artifact informations to categorize it within their internal structure.

Version:
$Revision: 1.2 $
Author:
Laurent Broudoux
See Also:
Artifact

Method Summary
 java.io.InputStream getArtifact(Artifact artifact)
          Retrieve the input stream corresponding to a given Artifact.
 void storeArtifact(Artifact artifact, java.io.File content)
          Store the content of a given Artifact within repository datastore.
 void storeArtifact(Artifact artifact, java.io.InputStream is)
          Store the content of a given Artifact within repository datastore using an input stream.
 

Method Detail

getArtifact

java.io.InputStream getArtifact(Artifact artifact)
                                throws ConnectionException,
                                       TransferException
Retrieve the input stream corresponding to a given Artifact. This method can be used for artifact content downloading or retrieval.

Parameters:
artifact - The domain object representing artifact to retrieve
Returns:
An InputStream on artifact content
Throws:
ConnectionException - if physical repository cannot be connected
TransferException - if something wrong occur after connection, during transfer

storeArtifact

void storeArtifact(Artifact artifact,
                   java.io.File content)
                   throws ConnectionException,
                          TransferException
Store the content of a given Artifact within repository datastore.

Parameters:
artifact - The domain object representing artifact to store
content - File representing artifact content (must not be a directory)
Throws:
ConnectionException - if physical repository cannot be connected
TransferException - if something wrong occur after connection, during transfer

storeArtifact

void storeArtifact(Artifact artifact,
                   java.io.InputStream is)
                   throws ConnectionException,
                          TransferException
Store the content of a given Artifact within repository datastore using an input stream.

Parameters:
artifact - The domain object representing artifact to store
is - InputStream on artifact content
Throws:
ConnectionException - if physical repository cannot be connected
TransferException - if something wrong occur after connection, during transfer


Copyright © 2005-2008 Join. All Rights Reserved.