public class FileItem extends Object
FileItem is ...
| Modifier and Type | Field and Description |
|---|---|
protected ByteArrayOutputStream |
m_body
Body stored in memory, filled in using this stream.
|
protected byte[] |
m_bodyBytes |
protected InputStream |
m_inputStream
Stream from which body can be read
|
protected String |
m_name
file name.
|
protected String |
m_type
file type.
|
protected static int |
STREAM_BUFFER_SIZE
The chunk size used when streaming (100k).
|
| Constructor and Description |
|---|
FileItem(String fileName,
String fileType)
Construct
|
FileItem(String fileName,
String fileType,
byte[] body) |
FileItem(String fileName,
String fileType,
InputStream stream) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
get()
Access the body as a byte array.
|
String |
getContentType() |
String |
getFileName() |
InputStream |
getInputStream()
Access the input stream from which the body can be read.
|
String |
getString()
Access the body as a String.
|
protected void |
stream2bodyBytes() |
protected static final int STREAM_BUFFER_SIZE
protected ByteArrayOutputStream m_body
protected byte[] m_bodyBytes
protected String m_name
protected String m_type
protected InputStream m_inputStream
public FileItem(String fileName, String fileType)
fileName - The file name.fileType - The file type.public FileItem(String fileName, String fileType, InputStream stream)
public String getFileName()
public String getContentType()
public String getString()
public byte[] get()
public InputStream getInputStream()
protected void stream2bodyBytes()
Copyright © 2003–2016 The Sakai Foundation. All rights reserved.