|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.servlet.UploadedFile
public class UploadedFile
This represents a single uploaded file extracted from a multipart form. The contents of the file are extracted using an InputStream. The contents of the file might come from an in-memory buffer, or from a temporary file.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Constructor Summary | |
---|---|
UploadedFile(java.lang.String pFilename,
java.lang.String pContentType,
int pFileSize,
byte[] pBuf)
Constructs a new UploadedFile whose contents are stored in the specified byte array. |
|
UploadedFile(java.lang.String pFilename,
java.lang.String pContentType,
int pFileSize,
java.io.File pFile)
Constructs a new UploadedFile whose contents are stored in the specified temporary file. |
Method Summary | |
---|---|
void |
deleteTemporaryFile()
Deletes the temporary file held by this value. |
java.lang.String |
getContentType()
Returns the content type of the uploaded file, as determined by the browser that uploaded the file. |
java.lang.String |
getFilename()
Returns the file name of the uploaded file. |
int |
getFileSize()
Returns the size of the uploaded file, in bytes. |
java.io.File |
getInputFile()
Returns the uploaded file object (if there is one). |
java.io.InputStream |
getInputStream()
Returns an InputStream that gives access to the contents of the uploaded file. |
void |
setFilename(java.lang.String pFilename)
Sets the file name of the uploaded file. |
byte[] |
toByteArray()
This is a convenience method that calls getInputStream() then reads all of the data from the input stream into a byte array that is returned. |
java.lang.String |
toString()
Returns a String representation of this, which is just the client's filename. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public UploadedFile(java.lang.String pFilename, java.lang.String pContentType, int pFileSize, java.io.File pFile)
public UploadedFile(java.lang.String pFilename, java.lang.String pContentType, int pFileSize, byte[] pBuf)
Method Detail |
---|
public void deleteTemporaryFile()
public java.lang.String toString()
toString
in class java.lang.Object
public void setFilename(java.lang.String pFilename)
public java.lang.String getFilename()
public java.lang.String getContentType()
public int getFileSize()
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
public java.io.File getInputFile()
getInputStream()
public byte[] toByteArray() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |