devpia.dextupload
Class FileUpload

java.lang.Object
  extended bydevpia.dextupload.ErrorManager
      extended bydevpia.dextupload.FileUpload

public class FileUpload
extends devpia.dextupload.ErrorManager

The most important object of component in charge of actually uploading files and saving on server.


Constructor Summary
FileUpload(javax.servlet.http.HttpServletRequest Request, javax.servlet.http.HttpServletResponse Response)
           
FileUpload(javax.servlet.http.HttpServletRequest Request, javax.servlet.http.HttpServletResponse Response, java.lang.String strCharSet)
           
 
Method Summary
 void DeleteSavedFiles()
          Deletes all files saved in server through upload.
 void dispose()
          Release the entire allocated resources.
 void Flush()
          Ignores all data sent by web browser without saving any files (including temporary files) to server.
 boolean getAutoMakeFolder()
          Seeks the property of AutoMakeFolder function.
 java.lang.String getCharacterEncoding()
          Seeks currently set Character Encoding value.
 FileItem getFileItem(java.lang.String _Name)
          Obtains file item corresponding with _Name transmitted by user.
 java.util.Map getFileItemMap()
          Obtains all file times transmitted by user in Map type.
 java.util.Enumeration getFileItemNames()
          Obtains all names of file item transmitted by user.
 FileItem[] getFileItemValues(java.lang.String _Name)
          Obtains all file items corresponding with _Name transmitted by user in arranged type.
 int getMaxFileLength()
          Seeks the maximum uploadable file size.
 int getMaxTotalLength()
          Seeks the total size of uploadable file.
 java.lang.String getParameter(java.lang.String _Name)
          Obtains form data transmitted by user.
 java.util.Map getParameterMap()
          Obtains all form data transmitted by user in Map type.
 java.util.Enumeration getParameterNames()
          Obtains names of all forms transmitted by user.
 java.lang.String[] getParameterValues(java.lang.String _Name)
          Obtains all form data corresponding with user transmitted _Nmae in array style.
 int getUploadedLength()
          Seeks all sizes of uploaded files (including form data).
 void setAutoMakeFolder(boolean bAutoMake)
          Automatically creates folder if assigned folder does not exist in DefaultPath, SaveAs.
 void setCharacterEncoding(java.lang.String strCharSet)
          Sets encoding value to be used when processing form data.
 void setLicenseFilePath(java.lang.String strLicenseFilePath)
          Set the location of dextuploadj.config file with authorization information.
 void setMaxFileLength(int nByteLength)
          Limits the maximum size of files for uploading.
 void setMaxTotalLength(int nByteLength)
          Limits the total size value of uploaded file.
 void SetProgress(int nID)
          Sets value transferred by GetProgressID() of Progress object.
 void UploadStart()
          Sets value transferred by GetProgressID() of Progress object.
 void UploadStart(java.lang.String DefaultPath)
          Sets value transferred by GetProgressID() of Progress object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUpload

public FileUpload(javax.servlet.http.HttpServletRequest Request,
                  javax.servlet.http.HttpServletResponse Response)
Parameters:
Request - JSP HttpServletRequest Object
Response - JSP HttpServletResponse Object

FileUpload

public FileUpload(javax.servlet.http.HttpServletRequest Request,
                  javax.servlet.http.HttpServletResponse Response,
                  java.lang.String strCharSet)
Parameters:
Request - JSP HttpServletRequest Object
Response - JSP HttpServletResponse Object
strCharSet - Encoding character set
Method Detail

dispose

public void dispose()
             throws java.io.IOException,
                    DEXTUploadException
Release the entire allocated resources. Temporary files at assigned DefaultPath may not be deleted when UploadStart() method is executed if this method is not called when ending.

Throws:
java.io.IOException
DEXTUploadException

UploadStart

public void UploadStart()
                 throws DEXTUploadException,
                        java.io.IOException
Process multipart/form-data uploaded by user.

Throws:
DEXTUploadException
java.io.IOException

UploadStart

public void UploadStart(java.lang.String DefaultPath)
                 throws DEXTUploadException,
                        java.io.IOException
Process multipart/form-data uploaded by user..

Parameters:
DefaultPath - Basic route value to save temporary files and uploaded files. This folder must have authority to write/delete file.
Throws:
DEXTUploadException
java.io.IOException

Flush

public void Flush()
           throws DEXTUploadException,
                  java.io.IOException
Ignores all data sent by web browser without saving any files (including temporary files) to server.

Throws:
DEXTUploadException
java.io.IOException

getParameter

public java.lang.String getParameter(java.lang.String _Name)
Obtains form data transmitted by user. Obtains the first form data if duplicated name is used.

Parameters:
_Name - Form name
Returns:
First form data corresponding with _Name

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String _Name)
Obtains all form data corresponding with user transmitted _Name in array style.

Parameters:
_Name - Form name
Returns:
All form data corresponding with _Name

getParameterMap

public java.util.Map getParameterMap()
Obtains all form data transmitted by user in Map type.

Returns:
All form data transmitted by user

getParameterNames

public java.util.Enumeration getParameterNames()
Obtains names of all forms transmitted by user.

Returns:
Name of all form data transmitted by user

getFileItem

public FileItem getFileItem(java.lang.String _Name)
Obtains file item corresponding with _Name transmitted by user. Obtains the first file item data if duplicated name is used.

Parameters:
_Name - Form name
Returns:
First FileItem corresponding with _Name

getFileItemValues

public FileItem[] getFileItemValues(java.lang.String _Name)
Obtains all file items corresponding with _Name transmitted by user in arranged type.

Parameters:
_Name - Form name
Returns:
All form data corresponding with _Name

getFileItemMap

public java.util.Map getFileItemMap()
Obtains all file times transmitted by user in Map type.

Returns:
All FileItem transmitted by user

getFileItemNames

public java.util.Enumeration getFileItemNames()
Obtains all names of file item transmitted by user.

Returns:
Names of all FileItem transmitted by user

setAutoMakeFolder

public void setAutoMakeFolder(boolean bAutoMake)
Automatically creates folder if assigned folder does not exist in DefaultPath, SaveAs.

Parameters:
bAutoMake - true – automatically creates folder it folder does not exist, false – does not create folder even when folder does not exist

getAutoMakeFolder

public boolean getAutoMakeFolder()
Seeks the property of AutoMakeFolder function.

Returns:
true – set to automatically create folder, false – does not automatically create folder

setMaxFileLength

public void setMaxFileLength(int nByteLength)
                      throws DEXTUploadException
Limits the maximum size of files for uploading. Error when files bigger than assigned size are uploaded. Standard value is '2GB'. Possible to assign maximum of 2*1024*1024*1024-1(2GB).

Parameters:
nByteLength - - File size (byte)
Throws:
DEXTUploadException

getMaxFileLength

public int getMaxFileLength()
Seeks the maximum uploadable file size.

Returns:
Size of maximum uploadable file

setMaxTotalLength

public void setMaxTotalLength(int nByteLength)
                       throws DEXTUploadException
Limits the total size value of uploaded files. (Ex: when uploading multiple files) Standard value is '2GB'. Possible to assign maximum of 2*1024*1024*1024-1(2GB).

Parameters:
nByteLength - - File size (byte)
Throws:
DEXTUploadException

getMaxTotalLength

public int getMaxTotalLength()
Seeks the total size of uploadable file.

Returns:
Total size of uploadable files

getUploadedLength

public int getUploadedLength()
                      throws DEXTUploadException
Seeks all sizes of uploaded files (including form data).

Returns:
Size of all uploaded files (including form data)
Throws:
DEXTUploadException

setCharacterEncoding

public void setCharacterEncoding(java.lang.String strCharSet)
                          throws DEXTUploadException
Set encoding value to be used when processing form data. (Standard value is UTF-8)

Parameters:
strCharSet - Encoding character set
Throws:
DEXTUploadException

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Currently set Character Encoding value

Returns:
Currently set Character Encoding value

setLicenseFilePath

public void setLicenseFilePath(java.lang.String strLicenseFilePath)
Set the location of dextuploadj.config file with authorization information. Folder with dextuploadj.config file should be authorized to write/delete files.

Parameters:
strLicenseFilePath - Physical route of dextuploadj.config file

DeleteSavedFiles

public void DeleteSavedFiles()
                      throws DEXTUploadException
Deletes all files saved in server through upload.

Throws:
DEXTUploadException

SetProgress

public void SetProgress(int nID)
                 throws DEXTUploadException
Sets value transferred by GetProgressID() of Progress object.

Parameters:
nID - - Value handed over by GetProgressID() of Progress object
Throws:
DEXTUploadException
See Also:
Progress.GetProgressID()