fr.paris.lutece.plugins.blobstore.business.filesystem
Class FileSystemBlobStoreDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.blobstore.business.filesystem.FileSystemBlobStoreDAO
All Implemented Interfaces:
IFileSystemBlobStoreDAO

public class FileSystemBlobStoreDAO
extends java.lang.Object
implements IFileSystemBlobStoreDAO

Uses filesystem to store blob. Note that strBasePath is the path were blobs are put.


Constructor Summary
FileSystemBlobStoreDAO()
           
 
Method Summary
 boolean delete(java.lang.String strKey, java.lang.String strBasePath)
          Removes the file
 void insert(BytesBlobStore blobStore, java.lang.String strBasePath)
          Inserts the blobStore
 void insert(InputStreamBlobStore blobStore, java.lang.String strBasePath)
          Inserts the InputStreamDatabaseBlobStore
 BytesBlobStore load(java.lang.String strId, java.lang.String strBasePath)
          Load the data from the table
 java.io.InputStream loadInputStream(java.lang.String strId, java.lang.String strBasePath)
          Loads the InputStreamDatabaseBlobStore
 void store(BytesBlobStore blobStore, java.lang.String strBasePath)
          Updates the file
 void storeInputStream(InputStreamBlobStore blobStore, java.lang.String strBasePath)
          Updates the file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemBlobStoreDAO

public FileSystemBlobStoreDAO()
Method Detail

insert

public void insert(BytesBlobStore blobStore,
                   java.lang.String strBasePath)
            throws java.io.IOException,
                   FileAlreadyExistsException
Inserts the blobStore

Specified by:
insert in interface IFileSystemBlobStoreDAO
Parameters:
blobStore - blobStore
strBasePath - base directory
Throws:
java.io.IOException - ioexception
FileAlreadyExistsException - if the file already exists

insert

public void insert(InputStreamBlobStore blobStore,
                   java.lang.String strBasePath)
            throws FileAlreadyExistsException,
                   java.io.IOException
Inserts the InputStreamDatabaseBlobStore

Specified by:
insert in interface IFileSystemBlobStoreDAO
Parameters:
blobStore - blobStore
strBasePath - base directory
Throws:
FileAlreadyExistsException - if the file already exists
java.io.IOException - ioexception

load

public BytesBlobStore load(java.lang.String strId,
                           java.lang.String strBasePath)
                    throws java.io.IOException
Load the data from the table

Specified by:
load in interface IFileSystemBlobStoreDAO
Parameters:
strId - The identifier
strBasePath - base directory
Returns:
the instance of the DatabaseBlobStore
Throws:
java.io.IOException - ioexception

loadInputStream

public java.io.InputStream loadInputStream(java.lang.String strId,
                                           java.lang.String strBasePath)
                                    throws java.io.IOException
Loads the InputStreamDatabaseBlobStore

Specified by:
loadInputStream in interface IFileSystemBlobStoreDAO
Parameters:
strId - id
strBasePath - base path
Returns:
the InputStreamDatabaseBlobStore
Throws:
java.io.IOException - ioexception

store

public void store(BytesBlobStore blobStore,
                  java.lang.String strBasePath)
           throws java.io.IOException
Updates the file

Specified by:
store in interface IFileSystemBlobStoreDAO
Parameters:
blobStore - the blob
strBasePath - the base directory
Throws:
java.io.IOException - ioexception

storeInputStream

public void storeInputStream(InputStreamBlobStore blobStore,
                             java.lang.String strBasePath)
                      throws java.io.IOException
Updates the file

Specified by:
storeInputStream in interface IFileSystemBlobStoreDAO
Parameters:
blobStore - the blob
strBasePath - the base directory
Throws:
java.io.IOException - ioexception

delete

public boolean delete(java.lang.String strKey,
                      java.lang.String strBasePath)
               throws java.io.IOException
Removes the file

Specified by:
delete in interface IFileSystemBlobStoreDAO
Parameters:
strKey - the key
strBasePath - the base directory
Returns:
true if the file is deleted, false otherwise
Throws:
java.io.IOException - ioexception


Copyright © 2011 Mairie de Paris. All Rights Reserved.