|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.struts.upload.DiskFile
| Field Summary | |
protected java.lang.String |
contentType
Deprecated. The content type of the file |
protected java.lang.String |
fileName
Deprecated. The name of the file |
protected java.lang.String |
filePath
Deprecated. The filepath to the temporary file |
protected int |
fileSize
Deprecated. The size in bytes of the file |
| Constructor Summary | |
DiskFile(java.lang.String filePath)
Deprecated. |
|
| Method Summary | |
void |
destroy()
Deprecated. Delete the temporary file. |
java.lang.String |
getContentType()
Deprecated. Get the content type |
byte[] |
getFileData()
Deprecated. Attempt to read the temporary file and get it's data in byte array form. |
byte[] |
getFileData(int bufferSize)
Deprecated. Attempts to read a file n bytes at a time, n being equal to "bufferSize". |
java.lang.String |
getFileName()
Deprecated. Get the file name |
java.lang.String |
getFilePath()
Deprecated. Get the temporary file path for this form file |
int |
getFileSize()
Deprecated. Get the file size |
java.io.InputStream |
getInputStream()
Deprecated. Returns a FileInputStream to the file |
void |
setContentType(java.lang.String contentType)
Deprecated. Set the content type |
void |
setFileName(java.lang.String filename)
Deprecated. Set the file name |
void |
setFileSize(int fileSize)
Deprecated. Set the file size |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected java.lang.String filePath
protected java.lang.String contentType
protected int fileSize
protected java.lang.String fileName
| Constructor Detail |
public DiskFile(java.lang.String filePath)
| Method Detail |
public byte[] getFileData()
throws java.io.FileNotFoundException,
java.io.IOException
getFileData(int).
Note that this method can be dangerous, and that the size of a file
can cause an OutOfMemoryError quite easily. You should use
getInputStream and do your own thing.getFileData in interface FormFilejava.io.FileNotFoundException - If the temp file no longer existsjava.io.IOException - if there is some sort of IO problem.getFileData(int)
public byte[] getFileData(int bufferSize)
throws java.io.FileNotFoundException,
java.io.IOException
getInputStream and do your own thing.bufferSize - The size in bytes that are read from the file at a timejava.io.FileNotFoundException - If the temp file no longer existspublic void destroy()
destroy in interface FormFilepublic java.lang.String getFilePath()
public void setFileName(java.lang.String filename)
setFileName in interface FormFileorg.apache.struts.upload.FormFilefileName - The base file name.public void setContentType(java.lang.String contentType)
setContentType in interface FormFileorg.apache.struts.upload.FormFilecontentType - The content type for the file.public void setFileSize(int fileSize)
setFileSize in interface FormFilefileSize - The size of the file in bytespublic java.lang.String getFileName()
getFileName in interface FormFileorg.apache.struts.upload.FormFilepublic java.lang.String getContentType()
getContentType in interface FormFileorg.apache.struts.upload.FormFilepublic int getFileSize()
getFileSize in interface FormFile
public java.io.InputStream getInputStream()
throws java.io.FileNotFoundException,
java.io.IOException
getInputStream in interface FormFileorg.apache.struts.upload.FormFilejava.io.FileNotFoundException - if the uploaded file is not found.java.io.IOException - if an error occurred while reading the
file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||