public class UploadedFile
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field
|
| Constructor and Description |
|---|
UploadedFile(org.apache.struts.upload.FormFile aFormFile)
This is a constructor for this class.
|
UploadedFile(java.lang.String filename,
java.lang.String type,
com.ibm.commerce.server.MultipartInputStreamHandler in,
java.lang.String boundary)
This is a constructor for this class.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getContentType()
This method gets the content type of the uploaded file.
|
java.lang.String |
getFileName()
This method gets the uploaded file name.
|
java.io.InputStream |
getInputStream()
This method returns the uploaded file as an input stream.
|
int |
getLength()
This method gets the length of the file.
|
void |
readAndSaveFile(java.io.File f)
This method reads in the uploaded file and saves it in the given
File object. |
void |
readAndSaveFile(java.io.File f,
boolean saveData)
This method reads in the uploaded file and saves it in the given
File object. |
void |
setContentType(java.lang.String contentType)
This method sets the
contentType of the uploaded file. |
void |
setFileName(java.lang.String fileName)
This method sets the file name.
|
void |
setLength(int length)
This method sets the length if the file.
|
java.lang.String |
toString()
This method returns a
String representation of a file. |
public static final java.lang.String COPYRIGHT
public UploadedFile(java.lang.String filename,
java.lang.String type,
com.ibm.commerce.server.MultipartInputStreamHandler in,
java.lang.String boundary)
filename - The file name of the uploaded file.type - The file type of uploaded file.in - a MultipartInputSreamHandler object.boundary - The boundary of the uploaded file.public UploadedFile(org.apache.struts.upload.FormFile aFormFile)
UploadedFile instance based on a
FormFile object.aFormFile - The FormFile object used to create the UploadedFile instance.public java.io.InputStream getInputStream()
throws java.io.IOException
InputStream object.java.io.IOExceptionpublic void readAndSaveFile(java.io.File f,
boolean saveData)
throws java.io.IOException
File object.
If the content data is saved before, the saved data is written out instead.f - A File object.saveData - Also save the content of the uploaded file in a byte array object if the value is true.java.io.IOExceptionpublic void readAndSaveFile(java.io.File f)
throws java.io.IOException
File object.f - A File object.java.io.IOExceptionpublic java.lang.String getContentType()
public java.lang.String getFileName()
public int getLength()
public void setLength(int length)
length - The value of the length to set.public void setContentType(java.lang.String contentType)
contentType of the uploaded file.contentType - The contentType to set.public java.lang.String toString()
String representation of a file.toString in class java.lang.ObjectString representation of the uploaded file.public void setFileName(java.lang.String fileName)
fileName - The file name to set.