public interface HttpData extends InterfaceHttpData, io.netty.buffer.ByteBufHolder
InterfaceHttpData.HttpDataType| Modifier and Type | Method and Description |
|---|---|
void |
addContent(io.netty.buffer.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() |
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() |
byte[] |
get()
Returns the contents of the file item as an array of bytes.
|
io.netty.buffer.ByteBuf |
getByteBuf()
Returns the content of the file item as a ByteBuf
|
Charset |
getCharset()
Returns the Charset passed by the browser or null if not defined.
|
io.netty.buffer.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.
|
File |
getFile() |
long |
getMaxSize()
Returns the maxSize for this HttpData.
|
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 |
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(File dest)
A convenience getMethod to write an uploaded item to disk.
|
HttpData |
replace(io.netty.buffer.ByteBuf content) |
HttpData |
retain() |
HttpData |
retain(int increment) |
HttpData |
retainedDuplicate() |
void |
setCharset(Charset charset)
Set the Charset passed by the browser if defined
|
void |
setContent(io.netty.buffer.ByteBuf 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)
|
void |
setMaxSize(long maxSize)
Set the maxSize for this HttpData.
|
HttpData |
touch() |
HttpData |
touch(Object hint) |
getHttpDataType, getNamecompareTolong getMaxSize()
void setMaxSize(long maxSize)
void checkSize(long newSize)
throws IOException
IOExceptionvoid setContent(io.netty.buffer.ByteBuf buffer)
throws IOException
buffer - must be not nullIOExceptionvoid addContent(io.netty.buffer.ByteBuf buffer,
boolean last)
throws IOException
buffer - must be not null except if last is set to Falselast - True of the buffer is the last oneIOExceptionvoid setContent(File file) throws IOException
file - must be not nullIOExceptionvoid setContent(InputStream inputStream) throws IOException
inputStream - must be not nullIOExceptionboolean isCompleted()
long length()
long definedLength()
FileUpload or any known big Attribute.void delete()
byte[] get()
throws IOException
IOExceptionio.netty.buffer.ByteBuf getByteBuf()
throws IOException
IOExceptionio.netty.buffer.ByteBuf getChunk(int length)
throws IOException
IOExceptionString getString() throws IOException
IOExceptionString getString(Charset encoding) throws IOException
encoding - the charset to useIOExceptionvoid setCharset(Charset charset)
charset - Charset to set - must be not nullCharset getCharset()
boolean renameTo(File dest) throws IOException
dest - destination file - must be not nullIOExceptionboolean isInMemory()
File getFile() throws IOException
IOException - if this data is not represented by a fileHttpData copy()
copy in interface io.netty.buffer.ByteBufHolderHttpData duplicate()
duplicate in interface io.netty.buffer.ByteBufHolderHttpData retainedDuplicate()
retainedDuplicate in interface io.netty.buffer.ByteBufHolderHttpData replace(io.netty.buffer.ByteBuf content)
replace in interface io.netty.buffer.ByteBufHolderHttpData retain()
retain in interface io.netty.buffer.ByteBufHolderretain in interface InterfaceHttpDataretain in interface io.netty.util.ReferenceCountedHttpData retain(int increment)
retain in interface io.netty.buffer.ByteBufHolderretain in interface InterfaceHttpDataretain in interface io.netty.util.ReferenceCountedHttpData touch()
touch in interface io.netty.buffer.ByteBufHoldertouch in interface InterfaceHttpDatatouch in interface io.netty.util.ReferenceCountedHttpData touch(Object hint)
touch in interface io.netty.buffer.ByteBufHoldertouch in interface InterfaceHttpDatatouch in interface io.netty.util.ReferenceCountedCopyright © 2008–2017 The Netty Project. All rights reserved.