|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavazoom.upload.UploadBean
This class implements an UploadBean.
Features :
- Store file(s) under a remote folder.
- Store file(s) in a zip archive.
- Store file(s) in a database.
- Store file(s) in a memory folder.
- Events generated on upload.
Field Summary | |
static int |
DATABASESTORE
|
static java.lang.String |
EMPTYENTRY
|
static int |
FOLDERSTORE
|
static boolean |
INSERTASBYTES
Internal switch to use setBytes or setBinaryStream : Default is false (setBinaryStream) |
static int |
MAXUPLOADEDFILES
Maximum uploaded files. |
static long |
MAXUPLOADEDFILESIZE
Size limit for an uploaded file. |
static int |
MEMORYSTORE
|
static char |
SEPARATOR
|
static int |
SERIALIZEDFILESTORE
Reserved for future usage. |
static java.lang.String |
SQLUPLOADFILE
Column name to store uploaded data : Default is BINARYFILE |
static java.lang.String |
SQLUPLOADFILENAME
Column name to store uploaded filename : Default is FILENAME |
static java.lang.String |
SQLUPLOADFILESIZE
Column name to store uploaded filesize : Default is FILESIZE |
static java.lang.String |
SQLUPLOADFILETYPE
Column name to store uploaded filetype : Default is FILETYPE |
static java.lang.String |
SQLUPLOADID
Column name to store uploaded file id : Default is UPLOADID |
static java.lang.String |
SQLUPLOADTABLE
Database table name to store uploaded file : Default is UPLOADS |
static int |
TARGZIPFILESTORE
Reserved for future usage. |
static int |
TRANSFERBUFFERSIZE
|
static java.lang.String |
VERSION
|
static int |
XMLFILESTORE
Reserved for future usage. |
static int |
ZIPFILESTORE
|
Constructor Summary | |
UploadBean()
Dummy constructor (needed for JavaBeans). |
Method Summary | |
void |
addUploadListener(UploadListener listener)
Adds UploadListener to be notified. |
long |
computeCRC32(java.io.File file,
long offset)
Compute CRC32 for a given filename. |
byte[] |
computeMD5(java.io.File file,
long offset)
Compute MD5 for a given filename. |
java.lang.String |
getBlacklist()
Returns blacklist. |
java.sql.Connection |
getDatabasestore()
Returns database store connection. |
DBStore |
getDatabasestoreimplementation()
Returns database store concrete implementation. |
boolean |
getDump()
Get dump mode. |
long |
getFilesizelimit()
Returns maximum size allowed for an uploaded file. |
java.lang.String |
getFolderstore()
Returns store folder. |
java.util.Vector |
getHistory()
Returns a Vector[UploadParameters]. |
int |
getMaxfiles()
Returns maximum amount of stored files. |
java.util.Vector |
getMemorystore()
Returns a Vector[UploadFile] from memory store. |
boolean |
getOverwrite()
Returns overwrite state. |
java.lang.String |
getOverwritepolicy()
Return overwrite policy. |
java.lang.String |
getParser()
Gets current multipart parser. |
java.lang.String |
getParsertmpdir()
Gets multipart parser tempory directory if applicable. |
java.lang.String |
getWhitelist()
Returns whitelist. |
java.lang.String |
getZipfilestore()
Returns zip store filename. |
java.lang.String |
hexDump(byte[] in)
Dump byte array to hexadecimal string. |
boolean |
isBlacklistEnabled()
Returns true if blacklist is enabled or false if whitelist is enabled. |
OverwriteFilter |
loadOverwriteFilter()
Returns Overwrite Filter. |
void |
resetStore()
Cleans and resets the current store. |
void |
setBlacklist(java.lang.String blacklist)
Setup blacklist : filenames separated by comma. |
void |
setDatabasestore(java.sql.Connection jdbcconnection)
Setup the store database that suits to JDBC 2.0 extension. |
void |
setDatabasestore(java.lang.String driver,
java.lang.String URL,
java.util.Properties credentials)
Setup the store database. |
void |
setDatabasestoreimplementation(java.lang.String impl)
Setup your own database store implemention DBStore API compliant. |
void |
setDump(boolean dmp)
Set dump mode. |
void |
setFilesizelimit(long max)
Sets maximum size allowed for an uploaded file. |
void |
setFolderstore(java.lang.String serverfolder)
Sets the remote store folder. |
void |
setMaxfiles(int max)
Sets maximum amount of stored files. |
void |
setMemorystore()
Sets the memory store folder. |
void |
setOverwrite(boolean overwrite)
Enables/Disables entry overwrite. |
void |
setOverwritepolicy(java.lang.String policy)
Set overwrite policy. |
void |
setParser(java.lang.String parserid)
Selects a multipart Parser. |
void |
setParsertmpdir(java.lang.String dir)
Sets temporary directory for Struts multipart parser only. |
void |
setStoremodel(int storeid)
Selects the store model. |
void |
setWhitelist(java.lang.String whitelist)
Setup whitelist : filenames separated by comma. |
void |
setZipfilestore(java.lang.String file)
Sets the remote store zipfile. |
void |
store(MultipartFormDataRequest mrequest)
Moves all files to the store. |
void |
store(MultipartFormDataRequest mrequest,
java.lang.String field)
Moves one file identified by its form field to the store. |
void |
store(MultipartFormDataRequest mrequest,
java.lang.String field,
java.util.Map extra)
Moves one file identified by its form field to the store and pass extra parameters. |
void |
updateOverwriteFilter(OverwriteFilter filter)
Replace Overwrite filter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String VERSION
public static final int MAXUPLOADEDFILES
public static final long MAXUPLOADEDFILESIZE
public static char SEPARATOR
public static final int MEMORYSTORE
public static final int FOLDERSTORE
public static final int DATABASESTORE
public static final int ZIPFILESTORE
public static final int TARGZIPFILESTORE
public static final int SERIALIZEDFILESTORE
public static final int XMLFILESTORE
public static final java.lang.String EMPTYENTRY
public static int TRANSFERBUFFERSIZE
public static java.lang.String SQLUPLOADTABLE
public static java.lang.String SQLUPLOADID
public static java.lang.String SQLUPLOADFILENAME
public static java.lang.String SQLUPLOADFILE
public static java.lang.String SQLUPLOADFILESIZE
public static java.lang.String SQLUPLOADFILETYPE
public static boolean INSERTASBYTES
Constructor Detail |
public UploadBean()
Method Detail |
public void addUploadListener(UploadListener listener)
listener
- UploadListenerpublic void setStoremodel(int storeid) throws UploadException
storeid
- int
UploadException
public java.sql.Connection getDatabasestore()
public DBStore getDatabasestoreimplementation()
public java.lang.String getZipfilestore()
public java.lang.String getFolderstore()
public java.util.Vector getMemorystore()
public void setMemorystore() throws UploadException
UploadException
public void setFolderstore(java.lang.String serverfolder) throws UploadException
serverfolder
- String
UploadException
public void setZipfilestore(java.lang.String file) throws UploadException, java.io.IOException
file
- String
UploadException
java.io.IOException
public void setDatabasestoreimplementation(java.lang.String impl) throws UploadException
impl
- String
UploadException
public void setDatabasestore(java.lang.String driver, java.lang.String URL, java.util.Properties credentials) throws java.lang.Exception
driver
- StringURL
- Stringcredentials
- Properties
java.lang.Exception
public void setDatabasestore(java.sql.Connection jdbcconnection) throws java.lang.Exception
jdbcconnection
- Connection
java.lang.Exception
public java.lang.String getBlacklist()
public void setBlacklist(java.lang.String blacklist)
blacklist
- Stringpublic java.lang.String getWhitelist()
public void setWhitelist(java.lang.String whitelist)
whitelist
- Stringpublic boolean isBlacklistEnabled()
public void setOverwrite(boolean overwrite)
overwrite
- booleanpublic boolean getOverwrite()
public void setOverwritepolicy(java.lang.String policy)
policy
- Stringpublic java.lang.String getOverwritepolicy()
public void updateOverwriteFilter(OverwriteFilter filter)
filter
- OverwriteFilterpublic OverwriteFilter loadOverwriteFilter()
public boolean getDump()
public void setDump(boolean dmp)
dmp
- booleanpublic void setParser(java.lang.String parserid)
parserid
- MultipartFormDataRequest.COSPARSER, MultipartFormDataRequest.STRUTSPARSER, MultipartFormDataRequest.CFUPARSERpublic java.lang.String getParser()
public java.lang.String getParsertmpdir()
public void setParsertmpdir(java.lang.String dir)
dir
- Something like c:\\Temp or /tmppublic void setMaxfiles(int max)
max
- -1 means no limitpublic int getMaxfiles()
public long getFilesizelimit()
public void setFilesizelimit(long max)
max
- longpublic long computeCRC32(java.io.File file, long offset)
file
- offset
- data range [0-offset] to compute CRC32, -1 for all data.
public byte[] computeMD5(java.io.File file, long offset)
file
- offset
- data range [0-offset] to compute MD5, -1 for all data.
public java.lang.String hexDump(byte[] in)
in
-
public void store(MultipartFormDataRequest mrequest, java.lang.String field, java.util.Map extra) throws UploadException, java.io.IOException
mrequest
- field
- extra
- parameters
UploadException
java.io.IOException
public void store(MultipartFormDataRequest mrequest, java.lang.String field) throws UploadException, java.io.IOException
mrequest
- field
-
UploadException
java.io.IOException
public void store(MultipartFormDataRequest mrequest) throws UploadException, java.io.IOException
mrequest
-
UploadException
java.io.IOException
public java.util.Vector getHistory()
public void resetStore() throws UploadException, java.io.IOException
UploadException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |