public class FileParameter
extends java.lang.Object
Created: 2008. 04. 11 PM 4:19:40
| Modifier and Type | Field | Description |
|---|---|---|
protected java.io.File |
savedFile |
| Modifier | Constructor | Description |
|---|---|---|
protected |
FileParameter() |
Instantiates a new FileParameter.
|
|
FileParameter(java.io.File file) |
Instantiates a new FileParameter.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
delete() |
Delete a file.
|
byte[] |
getBytes() |
Returns the contents of the file in a byte array.
|
java.lang.String |
getContentType() |
Gets the the content type of the file.
|
java.io.File |
getFile() |
|
java.lang.String |
getFileName() |
Gets the actual name of the file uploaded.
|
long |
getFileSize() |
Gets the size of the file uploaded.
|
java.io.InputStream |
getInputStream() |
Returns an
InputStream object of the file. |
java.io.File |
getSavedFile() |
Returns the saved file.
|
boolean |
isRefused() |
Checks if the file is refused.
|
void |
release() |
Sets the access permission that allow write operations on the file associated with this FileParameter.
|
void |
rollback() |
If the saved file exists, delete it.
|
java.io.File |
saveAs(java.io.File destFile) |
Save an uploaded file as a given destination file.
|
java.io.File |
saveAs(java.io.File destFile,
boolean overwrite) |
Save an file as a given destination file.
|
void |
setRefused(boolean refused) |
Sets whether the refused file.
|
java.lang.String |
toString() |
protected FileParameter()
public FileParameter(java.io.File file)
file - the filepublic java.io.File getFile()
public java.lang.String getFileName()
public long getFileSize()
public java.lang.String getContentType()
public java.io.InputStream getInputStream()
throws java.io.IOException
InputStream object of the file.OutputStream that can be used
for storing the contents of the file.java.io.IOException - if an I/O error has occurredpublic byte[] getBytes()
throws java.io.IOException
java.io.IOException - if an I/O error has occurredpublic boolean isRefused()
public void setRefused(boolean refused)
refused - whether the file is refused or notpublic java.io.File saveAs(java.io.File destFile)
throws java.io.IOException
destFile - the destination filejava.io.IOException - if an I/O error has occurredpublic java.io.File saveAs(java.io.File destFile,
boolean overwrite)
throws java.io.IOException
destFile - the destination fileoverwrite - whether to overwrite if it already existsjava.io.IOException - if an I/O error has occurredpublic java.io.File getSavedFile()
public void delete()
public void rollback()
public void release()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2018 The Aspectran Project. All rights reserved.