public class FormFile extends Object implements Serializable
org.apache.struts.upload.S2MultipartRequestHandler.S2FormFile
を統合する。org.apache.struts.upload.FormFile
,
直列化された形式コンストラクタと説明 |
---|
FormFile() |
修飾子とタイプ | メソッドと説明 |
---|---|
void |
destroy()
Destroys all content for the uploaded file, including any
underlying data files.
|
String |
getContentType() |
byte[] |
getFileData()
Returns the data for the entire file as byte array.
|
String |
getFileName()
Returns the file name of this file.
|
int |
getFileSize()
Returns the size of this file.
|
InputStream |
getInputStream()
Returns an input stream for this file.
|
File |
getSaveFile() |
void |
setContentType(String contentType) |
void |
setFileName(String fileName)
Sets the file name of this file.
|
void |
setSaveFile(File saveFile) |
public String getContentType()
public void setContentType(String contentType)
contentType
- セットする contentTypepublic int getFileSize()
Returns the size of this file.
public String getFileName()
Returns the file name of this file. This is the base name of the file, as supplied by the user when the file was uploaded.
public void setFileName(String fileName)
Sets the file name of this file.
fileName
- The base file name.public byte[] getFileData() throws FileNotFoundException, IOException
Returns the data for the entire file as byte array. Care is needed
when using this method, since a large upload could easily exhaust
available memory. The preferred method for accessing the file data is
getInputStream
.
FileNotFoundException
- if the uploaded file is not found. Some
implementations may not deal with files and/or throw
this exception.IOException
- if an error occurred while reading the
file.public InputStream getInputStream() throws FileNotFoundException
Returns an input stream for this file. The caller must close the stream when it is no longer needed.
FileNotFoundException
- if the uploaded file is not found. Some
implementations may not deal with files and/or throw
this exception.public File getSaveFile()
public void setSaveFile(File saveFile)
saveFile
- セットする saveFilepublic void destroy()
Destroys all content for the uploaded file, including any underlying data files.