public interface HttpData extends InterfaceHttpData, ByteBufHolder
InterfaceHttpData.HttpDataType| Modifier and Type | Method and Description |
|---|---|
void |
addContent(ByteBuf buffer,
boolean last)
Add the content from the ChannelBuffer
|
void |
checkSize(long newSize)
Check if the new size is not reaching the max limit allowed.
|
HttpData |
copy()
Creates a deep copy of this
ByteBufHolder. |
long |
definedLength()
Returns the defined length of the HttpData.
|
void |
delete()
Deletes the underlying storage for a file item, including deleting any
associated temporary disk file.
|
HttpData |
duplicate()
Duplicates this
ByteBufHolder. |
byte[] |
get()
Returns the contents of the file item as an array of bytes.
|
ByteBuf |
getByteBuf()
Returns the content of the file item as a ByteBuf
|
java.nio.charset.Charset |
getCharset()
Returns the Charset passed by the browser or null if not defined.
|
ByteBuf |
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.
|
java.io.File |
getFile() |
long |
getMaxSize()
Returns the maxSize for this HttpData.
|
java.lang.String |
getString()
Returns the contents of the file item as a String, using the default
character encoding.
|
java.lang.String |
getString(java.nio.charset.Charset encoding)
Returns the contents of the file item as a String, using the specified
charset.
|
boolean |
isCompleted() |
boolean |
isInMemory()
Provides a hint as to whether or not the file contents will be read from
memory.
|
long |
length()
Returns the size in byte of the InterfaceHttpData
|
boolean |
renameTo(java.io.File dest)
A convenience getMethod to write an uploaded item to disk.
|
HttpData |
replace(ByteBuf content)
Returns a new
ByteBufHolder which contains the specified content. |
HttpData |
retain()
Increases the reference count by
1. |
HttpData |
retain(int increment)
Increases the reference count by the specified
increment. |
HttpData |
retainedDuplicate()
Duplicates this
ByteBufHolder. |
void |
setCharset(java.nio.charset.Charset charset)
Set the Charset passed by the browser if defined
|
void |
setContent(ByteBuf buffer)
Set the content from the ChannelBuffer (erase any previous data)
|
void |
setContent(java.io.File file)
Set the content from the file (erase any previous data)
|
void |
setContent(java.io.InputStream inputStream)
Set the content from the inputStream (erase any previous data)
|
void |
setMaxSize(long maxSize)
Set the maxSize for this HttpData.
|
HttpData |
touch()
Records the current access location of this object for debugging purposes.
|
HttpData |
touch(java.lang.Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
getHttpDataType, getNamecontentrefCnt, release, releaselong getMaxSize()
void setMaxSize(long maxSize)
void checkSize(long newSize)
throws java.io.IOException
java.io.IOExceptionvoid setContent(ByteBuf buffer) throws java.io.IOException
buffer - must be not nulljava.io.IOExceptionvoid addContent(ByteBuf buffer, boolean last) throws java.io.IOException
buffer - must be not null except if last is set to Falselast - True of the buffer is the last onejava.io.IOExceptionvoid setContent(java.io.File file)
throws java.io.IOException
file - must be not nulljava.io.IOExceptionvoid setContent(java.io.InputStream inputStream)
throws java.io.IOException
inputStream - must be not nulljava.io.IOExceptionboolean isCompleted()
long length()
long definedLength()
FileUpload or any known big Attribute.void delete()
byte[] get()
throws java.io.IOException
java.io.IOExceptionByteBuf getByteBuf() throws java.io.IOException
java.io.IOExceptionByteBuf getChunk(int length) throws java.io.IOException
java.io.IOExceptionjava.lang.String getString()
throws java.io.IOException
java.io.IOExceptionjava.lang.String getString(java.nio.charset.Charset encoding)
throws java.io.IOException
encoding - the charset to usejava.io.IOExceptionvoid setCharset(java.nio.charset.Charset charset)
charset - Charset to set - must be not nulljava.nio.charset.Charset getCharset()
boolean renameTo(java.io.File dest)
throws java.io.IOException
dest - destination file - must be not nulljava.io.IOExceptionboolean isInMemory()
java.io.File getFile()
throws java.io.IOException
java.io.IOException - if this data is not represented by a fileHttpData copy()
ByteBufHolderByteBufHolder.copy in interface ByteBufHolderHttpData duplicate()
ByteBufHolderByteBufHolder. Be aware that this will not automatically call ByteBufHolder.retain().duplicate in interface ByteBufHolderHttpData retainedDuplicate()
ByteBufHolderByteBufHolder. This method returns a retained duplicate unlike ByteBufHolder.duplicate().retainedDuplicate in interface ByteBufHolderByteBuf.retainedDuplicate()HttpData replace(ByteBuf content)
ByteBufHolderByteBufHolder which contains the specified content.replace in interface ByteBufHolderHttpData retain()
ReferenceCounted1.retain in interface ByteBufHolderretain in interface InterfaceHttpDataretain in interface ReferenceCountedHttpData retain(int increment)
ReferenceCountedincrement.retain in interface ByteBufHolderretain in interface InterfaceHttpDataretain in interface ReferenceCountedHttpData touch()
ReferenceCountedResourceLeakDetector. This method is a shortcut to touch(null).touch in interface ByteBufHoldertouch in interface InterfaceHttpDatatouch in interface ReferenceCountedHttpData touch(java.lang.Object hint)
ReferenceCountedResourceLeakDetector.touch in interface ByteBufHoldertouch in interface InterfaceHttpDatatouch in interface ReferenceCounted