com.ibm.commerce.server
Class UploadedFile

java.lang.Object
  com.ibm.commerce.server.UploadedFile

public class UploadedFile
extends java.lang.Object

The UploadedFile is an object that represents an uploaded file.


Field Summary
static java.lang.String COPYRIGHT
IBM copyright notice field
Constructor Summary
UploadedFile(java.lang.String filename, java.lang.String type, MultipartInputStreamHandler in, java.lang.String boundary)
uploaded File
Method Summary
java.lang.String getContentType()
Gets the content type for the file
java.lang.String getFileName()
Gets the uploaded file name
java.io.InputStream getInputStream()
Returns the uploaded file as an input stream.
int getLength()
Gets the length of the file
void readAndSaveFile(java.io.File f)
Reads in the uploaded file and save it into the given file.
void setContentType(java.lang.String contentType)
Sets the contentType
void setFileName(java.lang.String fileName)
Sets the fileName
void setLength(int length)
Sets the length
java.lang.String toString()
toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM copyright notice field
See Also:
Constant Field Values
Constructor Detail

UploadedFile

public UploadedFile(java.lang.String filename,
                    java.lang.String type,
                    MultipartInputStreamHandler in,
                    java.lang.String boundary)
uploaded File
Parameters:
filename - file name of uploaded file
type - file type of uploaded file
boundary - boundary of uplaoded file
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns the uploaded file as an input stream.
Returns:
InputStream
Throws:
java.io.IOException

readAndSaveFile

public void readAndSaveFile(java.io.File f)
                     throws java.io.IOException
Reads in the uploaded file and save it into the given file.
Throws:
java.io.IOException

getContentType

public java.lang.String getContentType()
Gets the content type for the file
Returns:
content type of the uploaded file

getFileName

public java.lang.String getFileName()
Gets the uploaded file name
Returns:
file name of uploaded file

getLength

public int getLength()
Gets the length of the file
Returns:
length of the file

setLength

public void setLength(int length)
Sets the length
Parameters:
length - The length to set

setContentType

public void setContentType(java.lang.String contentType)
Sets the contentType
Parameters:
contentType - The contentType to set

toString

public java.lang.String toString()
toString
Returns:
string form of the uploaded file

setFileName

public void setFileName(java.lang.String fileName)
Sets the fileName
Parameters:
fileName - The fileName to set

Feedback