|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.netty.handler.codec.http2.AbstractHttpData
org.jboss.netty.handler.codec.http2.AbstractMemoryHttpData
public abstract class AbstractMemoryHttpData
Abstract Memory HttpData implementation
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jboss.netty.handler.codec.http2.InterfaceHttpData |
---|
InterfaceHttpData.HttpDataType |
Field Summary | |
---|---|
protected boolean |
isRenamed
|
Fields inherited from class org.jboss.netty.handler.codec.http2.AbstractHttpData |
---|
charset, completed, definedSize, name, size |
Constructor Summary | |
---|---|
AbstractMemoryHttpData(String name,
Charset charset,
long size)
|
Method Summary | |
---|---|
void |
addContent(org.jboss.netty.buffer.ChannelBuffer buffer,
boolean last)
Add the content from the ChannelBuffer |
void |
delete()
Deletes the underlying storage for a file item, including deleting any associated temporary disk file. |
byte[] |
get()
Returns the contents of the file item as an array of bytes. |
org.jboss.netty.buffer.ChannelBuffer |
getChannelBuffer()
Utility to go from a In Memory FileUpload to a Disk (or another implementation) FileUpload |
org.jboss.netty.buffer.ChannelBuffer |
getChunk(int length)
Returns a ChannelBuffer for the content from the current position with at most length read bytes, increasing the current position of the Bytes read. |
File |
getFile()
|
String |
getString()
Returns the contents of the file item as a String, using the default character encoding. |
String |
getString(Charset encoding)
Returns the contents of the file item as a String, using the specified charset. |
boolean |
isInMemory()
Provides a hint as to whether or not the file contents will be read from memory. |
boolean |
renameTo(File dest)
A convenience method to write an uploaded item to disk. |
void |
setContent(org.jboss.netty.buffer.ChannelBuffer buffer)
Set the content from the ChannelBuffer (erase any previous data) |
void |
setContent(File file)
Set the content from the file (erase any previous data) |
void |
setContent(InputStream inputStream)
Set the content from the inputStream (erase any previous data) |
Methods inherited from class org.jboss.netty.handler.codec.http2.AbstractHttpData |
---|
getCharset, getName, isCompleted, length, setCharset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.netty.handler.codec.http2.HttpData |
---|
getCharset, isCompleted, length, setCharset |
Methods inherited from interface org.jboss.netty.handler.codec.http2.InterfaceHttpData |
---|
getHttpDataType, getName |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
protected boolean isRenamed
Constructor Detail |
---|
public AbstractMemoryHttpData(String name, Charset charset, long size) throws NullPointerException, IllegalArgumentException
NullPointerException
IllegalArgumentException
Method Detail |
---|
public void setContent(org.jboss.netty.buffer.ChannelBuffer buffer) throws IOException
HttpData
setContent
in interface HttpData
buffer
- must be not null
IOException
public void setContent(InputStream inputStream) throws IOException
HttpData
setContent
in interface HttpData
inputStream
- must be not null
IOException
public void addContent(org.jboss.netty.buffer.ChannelBuffer buffer, boolean last) throws IOException
HttpData
addContent
in interface HttpData
buffer
- must be not null except if last is set to Falselast
- True of the buffer is the last one
IOException
public void setContent(File file) throws IOException
HttpData
setContent
in interface HttpData
file
- must be not null
IOException
public void delete()
HttpData
delete
in interface HttpData
public byte[] get()
HttpData
get
in interface HttpData
public String getString()
HttpData
getString
in interface HttpData
public String getString(Charset encoding)
HttpData
getString
in interface HttpData
encoding
- the charset to use
public org.jboss.netty.buffer.ChannelBuffer getChannelBuffer()
getChannelBuffer
in interface HttpData
public org.jboss.netty.buffer.ChannelBuffer getChunk(int length) throws IOException
HttpData
getChunk
in interface HttpData
IOException
public boolean isInMemory()
HttpData
isInMemory
in interface HttpData
public boolean renameTo(File dest) throws IOException
HttpData
renameTo
in interface HttpData
dest
- destination file - must be not null
IOException
public File getFile() throws IOException
getFile
in interface HttpData
IOException
- if this data is not represented by a file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |