com.vinculumtech.platform.repository.fs
Class FSRepositoryHandler

java.lang.Object
  extended bycom.vinculumtech.platform.repository.RepositoryHandler
      extended bycom.vinculumtech.platform.repository.fs.FSRepositoryHandler

public class FSRepositoryHandler
extends RepositoryHandler

The FSRepository class is an implementation of the RepositoryHandler class.
This class provides a simple file system based repository implementation.
The repository root can be set with the PATH_ROOT property.

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/platform/repository/fs/FSRepositoryHandler.java#6 $

Field Summary
static java.lang.String PATH_ROOT
           
protected  java.lang.String pathRoot
           
 
Fields inherited from class com.vinculumtech.platform.repository.RepositoryHandler
REPOSITORY_HANDLER, REPOSITORY_HANDLER_CLASS
 
Constructor Summary
FSRepositoryHandler(java.util.Properties properties)
           
 
Method Summary
 void deleteFile(java.lang.String[] path, java.lang.String filename)
          Removes the given file from the repository.
 java.io.File getFile(java.lang.String[] path, java.lang.String filename)
          Returns a File referenced by the given filename and path.
 java.util.List getFileList(java.lang.String[] path)
          Returns a List of strings representing all the files in the given repository path or folder.
 java.util.List getFolderList(java.lang.String[] path)
          Returns a List of strings representing all the folders in the given repository path or folder.
 java.io.File getRootDirectory()
          Returns the root directory used by this RepositoryHandler instance.
protected  java.lang.String makeLocalPath(java.lang.String[] path)
           
 void putFile(java.io.File file, java.lang.String[] path, java.lang.String filename, java.lang.String contentType)
          Puts the file referenced by the given File instance into the repository under the given path and named to the given filename.
 void putFile(java.io.File file, java.lang.String[] path, java.lang.String filename, java.lang.String contentType, boolean deleteOriginal)
          Puts the file referenced by the given File instance into the repository under the given path and named to the given filename.
 
Methods inherited from class com.vinculumtech.platform.repository.RepositoryHandler
deleteFile, getFile, getFileList, getFolderList, getHandler, isEmpty, makePath, makePath, makePathArray, makePathArray, putFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_ROOT

public static final java.lang.String PATH_ROOT
See Also:
Constant Field Values

pathRoot

protected java.lang.String pathRoot
Constructor Detail

FSRepositoryHandler

public FSRepositoryHandler(java.util.Properties properties)
Method Detail

getRootDirectory

public java.io.File getRootDirectory()
                              throws RepositoryException
Description copied from class: RepositoryHandler
Returns the root directory used by this RepositoryHandler instance.

Specified by:
getRootDirectory in class RepositoryHandler
Returns:
Throws:
RepositoryException

getFile

public java.io.File getFile(java.lang.String[] path,
                            java.lang.String filename)
                     throws RepositoryException
Description copied from class: RepositoryHandler
Returns a File referenced by the given filename and path.

Specified by:
getFile in class RepositoryHandler
Parameters:
path -
filename -
Returns:
Throws:
RepositoryException

getFileList

public java.util.List getFileList(java.lang.String[] path)
Description copied from class: RepositoryHandler
Returns a List of strings representing all the files in the given repository path or folder.

Specified by:
getFileList in class RepositoryHandler
Parameters:
path -
Returns:

getFolderList

public java.util.List getFolderList(java.lang.String[] path)
Description copied from class: RepositoryHandler
Returns a List of strings representing all the folders in the given repository path or folder.

Specified by:
getFolderList in class RepositoryHandler
Parameters:
path -
Returns:

putFile

public void putFile(java.io.File file,
                    java.lang.String[] path,
                    java.lang.String filename,
                    java.lang.String contentType)
             throws RepositoryException
Description copied from class: RepositoryHandler
Puts the file referenced by the given File instance into the repository under the given path and named to the given filename.

Specified by:
putFile in class RepositoryHandler
Parameters:
file -
path -
filename -
contentType - the mimetype sent of the file
Throws:
RepositoryException

putFile

public void putFile(java.io.File file,
                    java.lang.String[] path,
                    java.lang.String filename,
                    java.lang.String contentType,
                    boolean deleteOriginal)
             throws RepositoryException
Description copied from class: RepositoryHandler
Puts the file referenced by the given File instance into the repository under the given path and named to the given filename.

Specified by:
putFile in class RepositoryHandler
Parameters:
file -
path -
filename -
contentType -
deleteOriginal - the mimetype sent of the file
Throws:
RepositoryException

deleteFile

public void deleteFile(java.lang.String[] path,
                       java.lang.String filename)
                throws RepositoryException
Description copied from class: RepositoryHandler
Removes the given file from the repository.

Specified by:
deleteFile in class RepositoryHandler
Parameters:
path -
filename -
Throws:
RepositoryException

makeLocalPath

protected java.lang.String makeLocalPath(java.lang.String[] path)


Copyright (C) 2002 Vinculum Technologies, Inc. All Rights Reserved.