public class CommonsMultipartFileParameter extends FileParameter
Created: 2008. 04. 11 PM 8:55:25
savedFile
Constructor and Description |
---|
CommonsMultipartFileParameter(org.apache.commons.fileupload.FileItem fileItem)
Create an instance wrapping the given FileItem.
|
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes the underlying Commons FileItem instances.
|
byte[] |
getBytes()
Return an byte array to read the contents of the file from.
|
String |
getContentType()
Gets the content type of the data being uploaded.
|
File |
getFile() |
String |
getFileName()
Returns the file name that was uploaded in the multipart form.
|
long |
getFileSize()
Returns the file size that was uploaded in the multipart form.
|
InputStream |
getInputStream()
Return an InputStream to read the contents of the file from.
|
String |
getStorageDescription()
Return a description for the storage location of the multipart content.
|
void |
release() |
File |
saveAs(File destFile,
boolean overwrite)
Save an uploaded file as a given destination file.
|
getSavedFile, isRefused, rollback, saveAs, setRefused, toString
public CommonsMultipartFileParameter(org.apache.commons.fileupload.FileItem fileItem)
fileItem
- the FileItem to wrappublic File getFile()
getFile
in class FileParameter
public String getContentType()
getContentType
in class FileParameter
public String getFileName()
getFileName
in class FileParameter
public long getFileSize()
getFileSize
in class FileParameter
public InputStream getInputStream() throws IOException
getInputStream
in class FileParameter
IOException
- in case of access errors (if the temporary store fails)public byte[] getBytes()
getBytes
in class FileParameter
public File saveAs(File destFile, boolean overwrite) throws IOException
saveAs
in class FileParameter
destFile
- the destination fileoverwrite
- whether to overwrite if it already existsIOException
- if an I/O error has occurredpublic void delete()
delete
in class FileParameter
public void release()
release
in class FileParameter
public String getStorageDescription()
Copyright © 2008–2017 Aspectran.com. All rights reserved.