public class FakeFileItem extends Object implements org.wisdom.api.http.FileItem
| Modifier and Type | Field and Description |
|---|---|
private String |
field
The field of the form having sent the file.
|
private File |
file
The file.
|
| Constructor and Description |
|---|
FakeFileItem(File file,
String field)
Creates a new fake file item.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
bytes() |
String |
field() |
boolean |
isInMemory()
This method is not usable from tests.
|
String |
mimetype()
Tries to guess the mime-type of the file by analyzing its extension.
|
String |
name() |
long |
size() |
InputStream |
stream() |
File |
toFile()
Gets a
File object for this uploaded file. |
private final File file
private final String field
public String field()
field in interface org.wisdom.api.http.FileItempublic String name()
name in interface org.wisdom.api.http.FileItempublic byte[] bytes()
bytes in interface org.wisdom.api.http.FileItempublic InputStream stream()
stream in interface org.wisdom.api.http.FileItempublic boolean isInMemory()
isInMemory in interface org.wisdom.api.http.FileItempublic String mimetype()
mimetype in interface org.wisdom.api.http.FileItempublic long size()
size in interface org.wisdom.api.http.FileItempublic File toFile()
File object for this uploaded file. This file is a temporary file.
Depending on how is handled the file upload, the file may already exist, or not (in-memory) and then is created.toFile in interface org.wisdom.api.http.FileItemCopyright © 2013–2015 Wisdom Framework. All rights reserved.