|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jspsmart.upload.SmartUpload
The object which perfoms the upload. date: 11 Jul 2000
Field Summary | |
static int |
SAVE_AUTO
|
static int |
SAVE_PHYSICAL
|
static int |
SAVE_VIRTUAL
|
Constructor Summary | |
SmartUpload()
SmartUpload Creates an new SmartUpload instance. |
Method Summary | |
void |
downloadField(java.sql.ResultSet rs,
java.lang.String columnName,
java.lang.String contentType,
java.lang.String destFileName)
downloadField Downloads a field from a database's table. |
void |
downloadFile(java.lang.String sourceFilePathName)
Downloads a file. |
void |
downloadFile(java.lang.String sourceFilePathName,
java.lang.String contentType)
Downloads a file. |
void |
downloadFile(java.lang.String sourceFilePathName,
java.lang.String contentType,
java.lang.String destFileName)
Downloads a file |
void |
downloadFile(java.lang.String sourceFilePathName,
java.lang.String contentType,
java.lang.String destFileName,
int blockSize)
Downloads a file. |
void |
fieldToFile(java.sql.ResultSet rs,
java.lang.String columnName,
java.lang.String destFilePathName)
Save a field from a database's table to a file. |
byte |
getBinaryData(int index)
getBinaryData Returns the byte corresponding to the table index containing the transmitted data. |
Files |
getFiles()
getFiles Returns the collection of the uploaded files. |
Request |
getRequest()
getRequest Returns the request object. |
int |
getSize()
getSize Returns the total size of data uploaded. |
void |
init(javax.servlet.ServletConfig config)
Deprecated. Since Version 2.1 of jspSmartUpload, use initialize(javax.servlet.ServletConfig, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) instead. |
void |
initialize(javax.servlet.jsp.PageContext pageContext)
Initialize the object with implicits objects. |
void |
initialize(javax.servlet.ServletConfig config,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initialize the object with implicits objects. |
void |
initialize(javax.servlet.ServletContext application,
javax.servlet.http.HttpSession session,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.jsp.JspWriter out)
Deprecated. initialize(javax.servlet.ServletConfig, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) instead. |
int |
save(java.lang.String destPathName)
Saves all the uploaded files in the specified destination. |
int |
save(java.lang.String destPathName,
int option)
Saves all the uploaded files in the specified destination. |
void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Deprecated. Since Version 2.1 of jspSmartUpload, use initialize(javax.servlet.ServletConfig, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) instead. |
void |
setAllowedFilesList(java.lang.String allowedFilesList)
Set the list of allowed files. |
void |
setContentDisposition(java.lang.String contentDisposition)
Sets the Content Disposition. |
void |
setDeniedFilesList(java.lang.String deniedFilesList)
Set the list of denied files. |
void |
setDenyPhysicalPath(boolean deny)
Sets if the component deny physical path. |
void |
setForcePhysicalPath(boolean force)
Sets if the component force physical path. |
void |
setMaxFileSize(long maxFileSize)
Sets the maximum file size. |
void |
setTotalMaxFileSize(long totalMaxFileSize)
Sets the total maximum file size. |
void |
upload()
upload Uploads data from the form. |
void |
uploadInFile(java.lang.String destFilePathName)
The uploadInFile method creates a new file with all data of the POST form. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int SAVE_AUTO
public static final int SAVE_VIRTUAL
public static final int SAVE_PHYSICAL
Constructor Detail |
public SmartUpload()
Method Detail |
public final void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
initialize(javax.servlet.ServletConfig, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
instead.
This method always must be called in first.
config
- the config objectpublic void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
initialize(javax.servlet.ServletConfig, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
instead.
This method always must be called after the init() method.
request
- the request object.response
- the response object.public final void initialize(javax.servlet.ServletConfig config, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
config
- The application object.request
- The request object.response
- The response object.public final void initialize(javax.servlet.jsp.PageContext pageContext) throws javax.servlet.ServletException
pageContext
- The pageContext object.public final void initialize(javax.servlet.ServletContext application, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.jsp.JspWriter out) throws javax.servlet.ServletException
initialize(javax.servlet.ServletConfig, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
instead.
application
- The application object.session
- The session object.request
- The request object.response
- The response object.out
- The out object.public void upload() throws javax.servlet.ServletException, java.io.IOException, SmartUploadException
public int save(java.lang.String destPathName) throws javax.servlet.ServletException, java.io.IOException, SmartUploadException
destPathName
- The destination path.public int save(java.lang.String destPathName, int option) throws javax.servlet.ServletException, java.io.IOException, SmartUploadException
destPathName
- The destination path.public int getSize()
public byte getBinaryData(int index)
index
- index of the Table.public Files getFiles()
public Request getRequest()
public void downloadFile(java.lang.String sourceFilePathName) throws javax.servlet.ServletException, java.io.IOException, SmartUploadException
sourceFilePathName
- The full path to the file to download.public void downloadFile(java.lang.String sourceFilePathName, java.lang.String contentType) throws javax.servlet.ServletException, java.io.IOException, SmartUploadException, SmartUploadException
sourceFilePathName
- The full path to the file to download.contentType
- the content typepublic void downloadFile(java.lang.String sourceFilePathName, java.lang.String contentType, java.lang.String destFileName) throws javax.servlet.ServletException, java.io.IOException, SmartUploadException
sourceFilePathName
- The full path to the file to download.contentType
- the content type.destFileName
- the suggested file name.public void downloadFile(java.lang.String sourceFilePathName, java.lang.String contentType, java.lang.String destFileName, int blockSize) throws javax.servlet.ServletException, java.io.IOException, SmartUploadException
sourceFilePathName
- The full path to the file to download.contentType
- the content typedestFileName
- the suggested file nameblockSize
- public void downloadField(java.sql.ResultSet rs, java.lang.String columnName, java.lang.String contentType, java.lang.String destFileName) throws javax.servlet.ServletException, java.io.IOException, java.sql.SQLException
rs
- the resulstet.columnName
- the column name.contentType
- the content type.destFileName
- the suggested file name.public void fieldToFile(java.sql.ResultSet rs, java.lang.String columnName, java.lang.String destFilePathName) throws javax.servlet.ServletException, java.io.IOException, SmartUploadException, java.sql.SQLException
rs
- the resulstet.columnName
- the column name.destFileName
- the suggested file name.public void setDeniedFilesList(java.lang.String deniedFilesList) throws javax.servlet.ServletException, java.io.IOException, java.sql.SQLException
Contains the list of file's extensions which are denied to be uploaded. If this list is empty then no files are denied. All the files with an extension in the DeniedFileslist are denied even if they are in the AllowedFilesList.
In order to deny the files without an extension the list must contain two commas ",,". By defect this property is empty.
deniedFilesList
- The list of denied filespublic void setAllowedFilesList(java.lang.String allowedFilesList)
In order to allow the files without extension list must contain two commas ",,". By defect this property is empty.
allowedFilesList
- the list of allowed filespublic void setDenyPhysicalPath(boolean deny)
Prevents to access a path other that a virtual path of the Web Server. By defect this property is false.
denyPhysicalPath
- is a booleanpublic void setForcePhysicalPath(boolean force)
By default, the component consider a path as a virtual path. To oblige the component to consider all path as physical path, set this property to true.
forcePhysicalPath
- The boolean value.public void setContentDisposition(java.lang.String contentDisposition)
contentDisposition
- The content disposition.public void setTotalMaxFileSize(long totalMaxFileSize)
Is the maximum allowed size of all files to be uploaded. If this value is null then there is no limit for the total file's size uploaded. By defect this property is null.
totalMaxFileSize
- the total max file sizepublic void setMaxFileSize(long maxFileSize)
Is the maximum allowed size of one file to be uploaded. If this value is null then there is no limit for the file's size uploaded. By defect this property is null.
maxFileSize
- the max file size.public void uploadInFile(java.lang.String destFilePathName) throws java.io.IOException, SmartUploadException
This method can't be called if the upload() method is already called.
destFilePathName
- The path of the file.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |