oracle.jsp.webutil.fileaccess
Class HttpDownloadBean
oracle.jsp.webutil.fileaccess.HttpDownloadBean
- public class HttpDownloadBean
- implements java.io.Serializable
This bean lists the files available for download based on the input
criteria. "*" as the source property gives everything under the basedir
or for database, removes the fileprefixColumn from the select. Connection
is saved in the session object.
- See Also:
- Serialized Form
HttpDownloadBean
public HttpDownloadBean()
listFiles
public void listFiles(javax.servlet.http.HttpServletRequest req)
throws FileAccessException
- List the files available for download
- Parameters:
request
- - HttpServletRequest request (request obj for jsp page)
setRecurse
public void setRecurse(java.lang.String s)
throws FileAccessException
- Parameters:
recurse
- The recurse value allows recursion into subdirectories
or 'LIKE' clause for database. Valid values are "true" and "false".
"true" is the default.
setRecurse
public void setRecurse(boolean recurse)
setSourceType
public void setSourceType(java.lang.String srcType)
throws FileAccessException
- Parameters:
sourceType
- The source type is 'filesystem' or
'database'. 'filesystem' is the default.
setSourceType
public void setSourceType(int srcType)
throws FileAccessException
setSource
public void setSource(java.lang.String s)
throws FileAccessException
- Parameters:
source
- The source value is the download directory
when source type is 'filesystem'. It is the value in the
fileprefix column for database download. There is no default.
setFileType
public void setFileType(java.lang.String s)
throws FileAccessException
- Parameters:
fileType
- The file type indicates whether the file will be
saved in a BLOB or CLOB column. 'binary' is the default which
indicates a BLOB. Any other value will mean a CLOB. It
has no effect on when the destination type is 'filesystem'.
setFileType
public void setFileType(int i)
throws FileAccessException
setTable
public void setTable(java.lang.String s)
throws FileAccessException
- Parameters:
tableName
- The tableName for saving the file in the database.
It defaults to fileaccess. The fileaccess table can be created with
fileaccess.sql.
setPrefixColumn
public void setPrefixColumn(java.lang.String s)
throws FileAccessException
- Parameters:
prefixColumn
- The prefix column name in the table which will
hold the file prefix or (i.e., source value).
It defaults to 'fileprefix' to match the value in fileaccess.sql.
setFileNameColumn
public void setFileNameColumn(java.lang.String s)
throws FileAccessException
- Parameters:
fileColName
- The name of the column which will hold the file name
It defaults to 'filename' to match the value in fileaccess.sql.
setDataColumn
public void setDataColumn(java.lang.String s)
throws FileAccessException
- Parameters:
dataColName
- The name of the BLOB or CLOB column which will
hold the file.
It defaults to 'data' to match the value in fileaccess.sql.
setConnection
public void setConnection(ConnBean cb)
- Parameters:
connBean
- The name of the connection bean which is created
to establish the connection to the database.
setConnection
public void setConnection(java.sql.Connection conn)
setBaseDir
public void setBaseDir(javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletRequest request)
throws FileAccessException
- Parameters:
servletContext
- - current ServletContext (application obj from jsp)request
- - current HttpServletRequest (request obj from jsp)
for file system, the basedir is defined in WEB-INF/fileaccess.properties
getRecurse
public java.lang.String getRecurse()
getSourceType
public java.lang.String getSourceType()
getSource
public java.lang.String getSource()
getFileType
public java.lang.String getFileType()
getTable
public java.lang.String getTable()
getPrefixColumn
public java.lang.String getPrefixColumn()
getFileNameColumn
public java.lang.String getFileNameColumn()
getDataColumn
public java.lang.String getDataColumn()
getFileNames
public java.util.Enumeration getFileNames()
- return the list of file that were uploaded
- Parameters:
fileNames
- Get the names of the files that were uploaded.