com.vinculumtech.platform.repository
Class RepositoryHandler

java.lang.Object
  extended bycom.vinculumtech.platform.repository.RepositoryHandler
Direct Known Subclasses:
FSRepositoryHandler

public abstract class RepositoryHandler
extends java.lang.Object

The RepositoryHandler abstract class provides a basic file management interface.

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/platform/repository/RepositoryHandler.java#5 $

Field Summary
static java.lang.String REPOSITORY_HANDLER
           
static java.lang.String REPOSITORY_HANDLER_CLASS
           
 
Constructor Summary
RepositoryHandler()
           
 
Method Summary
abstract  void deleteFile(java.lang.String[] path, java.lang.String filename)
          Removes the given file from the repository.
 void deleteFile(java.lang.String path, java.lang.String filename)
          Removes the given file from the repository.
abstract  java.io.File getFile(java.lang.String[] path, java.lang.String filename)
          Returns a File referenced by the given filename and path.
 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.
abstract  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.
abstract  java.util.List getFolderList(java.lang.String[] path)
          Returns a List of strings representing all the folders in the given repository path or folder.
static RepositoryHandler getHandler(java.util.Properties properties)
          Returns the singleton registered RepositoryHandler sub-class.
abstract  java.io.File getRootDirectory()
          Returns the root directory used by this RepositoryHandler instance.
protected static boolean isEmpty(java.lang.String string)
           
static java.lang.String makePath(java.lang.String[] pathArray)
          Collapses the given path array into a String.
static java.lang.String makePath(java.lang.String[] pathArray, java.lang.String delim)
          Collapses the given path array into a String.
static java.lang.String[] makePathArray(java.lang.String path)
          Breaks the given path into a path array.
static java.lang.String[] makePathArray(java.lang.String path, java.lang.String delim)
          Breaks the given path into a path array.
abstract  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.
abstract  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.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPOSITORY_HANDLER

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

REPOSITORY_HANDLER_CLASS

public static final java.lang.String REPOSITORY_HANDLER_CLASS
See Also:
Constant Field Values
Constructor Detail

RepositoryHandler

public RepositoryHandler()
Method Detail

getHandler

public static RepositoryHandler getHandler(java.util.Properties properties)
Returns the singleton registered RepositoryHandler sub-class.

Parameters:
properties -
Returns:

getRootDirectory

public abstract java.io.File getRootDirectory()
                                       throws RepositoryException
Returns the root directory used by this RepositoryHandler instance.

Returns:
Throws:
RepositoryException

getFile

public abstract java.io.File getFile(java.lang.String[] path,
                                     java.lang.String filename)
                              throws RepositoryException
Returns a File referenced by the given filename and path.

Parameters:
path -
filename -
Returns:
Throws:
RepositoryException

getFile

public java.io.File getFile(java.lang.String path,
                            java.lang.String filename)
                     throws RepositoryException
Returns a File referenced by the given filename and path.

Parameters:
path -
filename -
Returns:
Throws:
RepositoryException

getFileList

public abstract java.util.List getFileList(java.lang.String[] path)
                                    throws RepositoryException
Returns a List of strings representing all the files in the given repository path or folder.

Parameters:
path -
Returns:
Throws:
RepositoryException

getFileList

public java.util.List getFileList(java.lang.String path)
                           throws RepositoryException
Returns a List of strings representing all the files in the given repository path or folder.

Parameters:
path -
Returns:
Throws:
RepositoryException

getFolderList

public abstract java.util.List getFolderList(java.lang.String[] path)
                                      throws RepositoryException
Returns a List of strings representing all the folders in the given repository path or folder.

Parameters:
path -
Returns:
Throws:
RepositoryException

getFolderList

public java.util.List getFolderList(java.lang.String path)
                             throws RepositoryException
Returns a List of strings representing all the folders in the given repository path or folder.

Parameters:
path -
Returns:
Throws:
RepositoryException

putFile

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

Parameters:
file -
path -
filename -
contentType - the mimetype sent of the file
Throws:
RepositoryException

putFile

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

Parameters:
file -
path -
filename -
contentType -
deleteOriginal - 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)
             throws RepositoryException
Puts the file referenced by the given File instance into the repository under the given path and named to the given filename.

Parameters:
file -
path -
filename -
contentType -
Throws:
RepositoryException

deleteFile

public abstract void deleteFile(java.lang.String[] path,
                                java.lang.String filename)
                         throws RepositoryException
Removes the given file from the repository.

Parameters:
path -
filename -
Throws:
RepositoryException

deleteFile

public void deleteFile(java.lang.String path,
                       java.lang.String filename)
                throws RepositoryException
Removes the given file from the repository.

Parameters:
path -
filename -
Throws:
RepositoryException

isEmpty

protected static boolean isEmpty(java.lang.String string)

makePath

public static java.lang.String makePath(java.lang.String[] pathArray)
Collapses the given path array into a String.

Parameters:
pathArray -
Returns:

makePath

public static java.lang.String makePath(java.lang.String[] pathArray,
                                        java.lang.String delim)
Collapses the given path array into a String.

Parameters:
pathArray -
delim -
Returns:

makePathArray

public static java.lang.String[] makePathArray(java.lang.String path)
Breaks the given path into a path array.

Parameters:
path -
Returns:

makePathArray

public static java.lang.String[] makePathArray(java.lang.String path,
                                               java.lang.String delim)
Breaks the given path into a path array.

Parameters:
path -
delim -
Returns:


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