objectivehtml.struts
Class StrutsUploadedFile

java.lang.Object
  |
  +--objectivehtml.struts.StrutsUploadedFile
All Implemented Interfaces:
UploadedFile

public class StrutsUploadedFile
extends java.lang.Object
implements UploadedFile

This defines an uploaded file for the ohtml-struts framework.


Field Summary
protected  org.apache.struts.upload.FormFile m_objFormFile
          The reference to the struts FormFile object
 
Constructor Summary
StrutsUploadedFile()
           
 
Method Summary
 void destroy()
          Destroy all content for this form file.
 java.lang.String getContentType()
          Get the content type for this file.
 java.lang.String getFileName()
          Get the file name of this file.
 int getFileSize()
          Get the size of this file
 org.apache.struts.upload.FormFile getFormFile()
          Get a reference to the struts FormFile object.
 java.io.InputStream getInputStream()
          Get an InputStream that represents this file.
 void setContentType(java.lang.String sContentType)
          Set the content type for this file
 void setFileName(java.lang.String sFileName)
          Set the filename of this file
 void setFileSize(int nFileSize)
          Set the file size
protected  void setFormFile(org.apache.struts.upload.FormFile objFormFile)
          Set a reference to the struts FormFile object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_objFormFile

protected org.apache.struts.upload.FormFile m_objFormFile
The reference to the struts FormFile object
Constructor Detail

StrutsUploadedFile

public StrutsUploadedFile()
Method Detail

getFormFile

public org.apache.struts.upload.FormFile getFormFile()
Get a reference to the struts FormFile object.
Returns:
A FormFile object

setFormFile

protected void setFormFile(org.apache.struts.upload.FormFile objFormFile)
Set a reference to the struts FormFile object.
Parameters:
sContentType - The content type

getContentType

public java.lang.String getContentType()
Get the content type for this file.
Specified by:
getContentType in interface UploadedFile
Returns:
A String representing content type

setContentType

public void setContentType(java.lang.String sContentType)
Set the content type for this file
Specified by:
setContentType in interface UploadedFile
Parameters:
sContentType - The content type

getFileSize

public int getFileSize()
Get the size of this file
Specified by:
getFileSize in interface UploadedFile
Returns:
an int representing the size of the file in bytes

setFileSize

public void setFileSize(int nFileSize)
Set the file size
Specified by:
setFileSize in interface UploadedFile
Parameters:
nFileSize - an int reprsenting the size of the file in bytes

getFileName

public java.lang.String getFileName()
Get the file name of this file.
Specified by:
getFileName in interface UploadedFile
Returns:
a String reprsenting a file name

setFileName

public void setFileName(java.lang.String sFileName)
Set the filename of this file
Specified by:
setFileName in interface UploadedFile
Parameters:
sFileName - the name of the file

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.FileNotFoundException,
                                          java.io.IOException
Get an InputStream that represents this file.
Specified by:
getInputStream in interface UploadedFile
Throws:
java.io.FileNotFoundException - ff some sort of file representation cannot be found for the FormFile
java.io.IOException - ff there is some sort of IOException

destroy

public void destroy()
Destroy all content for this form file. Implementations should remove any temporary files or any temporary file data stored somewhere
Specified by:
destroy in interface UploadedFile