com.esri.aims.mtier.model.util
Class FileUpload

java.lang.Object
  extended by com.esri.aims.mtier.model.util.FileUpload

public class FileUpload
extends Object

Utility for file Upload with multipart/form-data


Constructor Summary
FileUpload()
           
 
Method Summary
 void doUpload(HttpServletRequest req)
          Used for file upload, extracts the data & the input values.
 String getBinaryExtension()
          Returns the File extension of Binary file.
 String getContentType()
          Returns the ContentType of the uploaded file.
 String getFieldValue(String fieldName)
          Returns the FieldValue of the input fields.
 long getFileLength()
          Returns the file length of the uploaded file.
 String getFilename()
          Returns the filename of the uploaded file.
 String getFilepath()
          Returns the full path of the uploaded file.
 String getUploadedFile()
          Returns the contents of the uploaded file as a string.
 InputStream getUploadedFileAsStream()
          Returns the contents of the uploaded file as inputstream.
 InputStream getUploadedFileAsStream(String encoding)
          Returns the contents of the uploaded file as inputstream.
 void setBinaryExtension(String value)
          Sets the File extension of Binary file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUpload

public FileUpload()
Method Detail

getFilename

public String getFilename()
Returns the filename of the uploaded file.

Returns:
String value.

getUploadedFile

public String getUploadedFile()
Returns the contents of the uploaded file as a string.

Returns:
String value.

getUploadedFileAsStream

public InputStream getUploadedFileAsStream()
Returns the contents of the uploaded file as inputstream.

Returns:
inputstream value.

getUploadedFileAsStream

public InputStream getUploadedFileAsStream(String encoding)
                                    throws UnsupportedEncodingException
Returns the contents of the uploaded file as inputstream.

Returns:
inputstream value.
Throws:
UnsupportedEncodingException

getFilepath

public String getFilepath()
Returns the full path of the uploaded file.

Returns:
string value.

getFileLength

public long getFileLength()
Returns the file length of the uploaded file.

Returns:
long value.

getContentType

public String getContentType()
Returns the ContentType of the uploaded file.

Returns:
string value.

getFieldValue

public String getFieldValue(String fieldName)
Returns the FieldValue of the input fields.

Returns:
string value.

getBinaryExtension

public String getBinaryExtension()
Returns the File extension of Binary file. For eg. mxd,pmf

Returns:
String File extension in comma seperated value

setBinaryExtension

public void setBinaryExtension(String value)
Sets the File extension of Binary file. Default value mxd,pmf
FileUpload upload = new FileUpload();
upload.setBinaryExtension(getBinaryExtension() + ",arc");


doUpload

public void doUpload(HttpServletRequest req)
              throws IOException
Used for file upload, extracts the data & the input values.

Throws:
IOException