org.figure8.join.services.repository
Class SimpleFileSystemRepository

java.lang.Object
  extended by org.figure8.join.services.repository.AbstractStructuredRepository
      extended by org.figure8.join.services.repository.SimpleFileSystemRepository
All Implemented Interfaces:
Repository

public class SimpleFileSystemRepository
extends AbstractStructuredRepository

This is a simple implementation of a Repository using the local file system as a storage area for Artifacts.
This implementation defines the following properties :

Version:
$Revision: 1.3 $
Author:
Laurent Broudoux

Field Summary
 
Fields inherited from class org.figure8.join.services.repository.AbstractStructuredRepository
CATEGORY_PROPERTY, DEFAULT_STRUCTURE, ID_PROPERTY, RELEASE_PROPERTY, VERSION_PROPERTY
 
Constructor Summary
SimpleFileSystemRepository()
          Creates a new instance of SimpleFileSystemRepository.
 
Method Summary
 java.io.InputStream getArtifact(Artifact artifact)
          Retrieve the input stream corresponding to a given Artifact.
 java.lang.String getRootDirectory()
           
 void setRootDirectory(java.lang.String root)
          Sets the path to root of the file system repository.
 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.
 
Methods inherited from class org.figure8.join.services.repository.AbstractStructuredRepository
getStructureDefinition, getStructurePath, setStructureDefinition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFileSystemRepository

public SimpleFileSystemRepository()
Creates a new instance of SimpleFileSystemRepository.

Method Detail

setRootDirectory

public void setRootDirectory(java.lang.String root)
                      throws InvalidParameterException
Sets the path to root of the file system repository.

Parameters:
root - Path to the file system repository
Throws:
InvalidParameterException - if root is null or not a valid directory

getRootDirectory

public java.lang.String getRootDirectory()
Returns:
Path to the file system repository

getArtifact

public 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

public 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 (may be a directory)
Throws:
ConnectionException - if physical repository cannot be connected
TransferException - if something wrong occur after connection, during transfer

storeArtifact

public 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.