example.filestorage
Class DerbyFileStorageDAO

java.lang.Object
  extended by example.filestorage.DerbyFileStorageDAO
All Implemented Interfaces:
FileStorageDAO

 class DerbyFileStorageDAO
extends java.lang.Object
implements FileStorageDAO

Author:
Sean C. Sullivan

Constructor Summary
DerbyFileStorageDAO()
           
 
Method Summary
private static FileInfo buildFileInfo(java.sql.ResultSet rs)
           
 boolean deleteFile(long id)
           
 boolean fileExists(java.lang.String filename)
           
 java.util.List getAllFiles()
           
 byte[] getFileData(long id)
           
 void getFileData(long id, java.io.OutputStream out)
           
 FileInfo getFileInfo(long id)
           
 FileInfo getFileInfo(java.lang.String filename)
           
protected  long insertNewFile(java.lang.String filename, java.io.InputStream input, int filesize)
           
 void overwriteFile(long id, java.io.InputStream input, int filesize)
           
 long saveFile(java.lang.String filename, java.io.InputStream input, int filesize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerbyFileStorageDAO

DerbyFileStorageDAO()
Method Detail

getFileInfo

public FileInfo getFileInfo(long id)
Specified by:
getFileInfo in interface FileStorageDAO

getFileInfo

public FileInfo getFileInfo(java.lang.String filename)
Specified by:
getFileInfo in interface FileStorageDAO

getFileData

public byte[] getFileData(long id)
Specified by:
getFileData in interface FileStorageDAO

getFileData

public void getFileData(long id,
                        java.io.OutputStream out)
Specified by:
getFileData in interface FileStorageDAO

buildFileInfo

private static FileInfo buildFileInfo(java.sql.ResultSet rs)
                               throws java.sql.SQLException
Throws:
java.sql.SQLException

getAllFiles

public java.util.List getAllFiles()
Specified by:
getAllFiles in interface FileStorageDAO
Returns:
a list that contains zero or more FileInfo objects

saveFile

public long saveFile(java.lang.String filename,
                     java.io.InputStream input,
                     int filesize)
Specified by:
saveFile in interface FileStorageDAO

insertNewFile

protected long insertNewFile(java.lang.String filename,
                             java.io.InputStream input,
                             int filesize)

fileExists

public boolean fileExists(java.lang.String filename)
Specified by:
fileExists in interface FileStorageDAO

overwriteFile

public void overwriteFile(long id,
                          java.io.InputStream input,
                          int filesize)
Specified by:
overwriteFile in interface FileStorageDAO

deleteFile

public boolean deleteFile(long id)
Specified by:
deleteFile in interface FileStorageDAO


Copyright © 2005 strutsblobapp.sourceforge.net. All Rights Reserved.