| Modifier and Type | Method and Description |
|---|---|
| public void | addContent(Buffer
must be not null except if last is set to False buffer, boolean True of the buffer is the last one last)Add the content from the ChannelBuffer
|
| public void | |
| public HttpData | |
| public long | Returns: the defined length of the HttpDataReturns the defined length of the HttpData. |
| public void | delete()
Deletes the underlying storage for a file item, including deleting any associated temporary disk file. |
| public byte[] | Returns: the contents of the file item as an array of bytes.Returns the contents of the file item as an array of bytes. |
| public Charset | Returns: the Charset passed by the browser or null if not defined.Returns the Charset passed by the browser or null if not defined. |
| public Buffer | Returns: a ChannelBuffer for the content from the current position or an EMPTY_BUFFER if there is no more data to returnReturns a ChannelBuffer for the content from the current position with at most length read bytes, increasing the current position of the Bytes read. |
| public File | |
| public long | |
| public String | Returns: the contents of the file item as a String, using the default character encoding.Returns the contents of the file item as a String, using the default character encoding. |
| public String | |
| public boolean | |
| public boolean | Returns: True if the file contents is in memory.Provides a hint as to whether or not the file contents will be read from memory. |
| public long | |
| public boolean | |
| public HttpData | |
| public void | setCharset(Charset
Charset to set - must be not null charset)Set the Charset passed by the browser if defined |
| public void | setContent(Buffer
must be not null buffer)Set the content from the ChannelBuffer (erase any previous data)
|
| public void | |
| public void | setContent(InputStream
must be not null inputStream)Set the content from the inputStream (erase any previous data) |
| public void | |
| public < the type of the exception thrown by the callback E extends Exception> void | usingBuffer(Helpers.
The file item buffer callback callbackCalls the passed callback to operate on the file item as a Buffer. |
| public < the type of the exception thrown by the callback E extends Exception> void | usingContent(Helpers.
The file item buffer callback callbackCalls the passed callback to operate on the file item as a Buffer. |
| addContent | back to summary |
|---|---|
| public void addContent(Buffer buffer, boolean last) throws IOException Add the content from the ChannelBuffer
| |
| checkSize | back to summary |
|---|---|
| public void checkSize(long newSize) throws IOException Check if the new size is not reaching the max limit allowed. The limit is always computed in terms of bytes. | |
| copy | back to summary |
|---|---|
| public HttpData copy() Creates a deep copy of this | |
| definedLength | back to summary |
|---|---|
| public long definedLength() Returns the defined length of the HttpData.
If no Content-Length is provided in the request, the defined length is
always 0 (whatever during decoding or in final state).
If Content-Length is provided in the request, this is this given defined length.
This value does not change, whatever during decoding or in the final state.
This method could be used for instance to know the amount of bytes transmitted for
one particular HttpData, for example one
| |
| delete | back to summary |
|---|---|
| public void delete() Deletes the underlying storage for a file item, including deleting any associated temporary disk file. | |
| get | back to summary |
|---|---|
| public byte[] get() throws IOException Returns the contents of the file item as an array of bytes. Note this method will allocate a lot of memory, if the data is currently stored on the file system.
| |
| getCharset | back to summary |
|---|---|
| public Charset getCharset() Returns the Charset passed by the browser or null if not defined.
| |
| getChunk | back to summary |
|---|---|
| public Buffer getChunk(int length) throws IOException Returns a ChannelBuffer for the content from the current position with at most length read bytes, increasing the current position of the Bytes read. Once it arrives at the end, it returns an EMPTY_BUFFER and it resets the current position to 0. Buffer ownersip: The buffer ownership of the returned buffer is transferred to the caller
| |
| getFile | back to summary |
|---|---|
public File getFile() throws IOException
| |
| getMaxSize | back to summary |
|---|---|
| public long getMaxSize() Returns the maxSize for this HttpData. | |
| getString | back to summary |
|---|---|
| public String getString() throws IOException Returns the contents of the file item as a String, using the default character encoding.
| |
| getString | back to summary |
|---|---|
| public String getString(Charset encoding) throws IOException Returns the contents of the file item as a String, using the specified charset. | |
| isCompleted | back to summary |
|---|---|
public boolean isCompleted()
| |
| isInMemory | back to summary |
|---|---|
| public boolean isInMemory() Provides a hint as to whether or not the file contents will be read from memory.
| |
| length | back to summary |
|---|---|
| public long length() Returns the size in byte of the InterfaceHttpData
| |
| renameTo | back to summary |
|---|---|
| public boolean renameTo(File dest) throws IOException A convenience getMethod to write an uploaded item to disk. If a previous one exists, it will be deleted. Once this getMethod is called, if successful, the new file will be out of the cleaner of the factory that creates the original InterfaceHttpData object.
| |
| replace | back to summary |
|---|---|
| public HttpData replace(Buffer content) Returns a new | |
| setCharset | back to summary |
|---|---|
| public void setCharset(Charset charset) Set the Charset passed by the browser if defined
| |
| setContent | back to summary |
|---|---|
| public void setContent(Buffer buffer) throws IOException Set the content from the ChannelBuffer (erase any previous data)
| |
| setContent | back to summary |
|---|---|
| public void setContent(File file) throws IOException Set the content from the file (erase any previous data)
| |
| setContent | back to summary |
|---|---|
| public void setContent(InputStream inputStream) throws IOException Set the content from the inputStream (erase any previous data)
| |
| setMaxSize | back to summary |
|---|---|
| public void setMaxSize(long maxSize) Set the maxSize for this HttpData. When limit will be reached, an exception will be raised. Setting it to (-1) means no limitation. By default, to be set from the HttpDataFactory. | |
| usingBuffer | back to summary |
|---|---|
| public <E extends Exception> void usingBuffer(Helpers. Calls the passed callback to operate on the file item as a Buffer. Note this method will allocate a lot of memory, if the data is currently stored on the file system. Buffer ownersip: The ownership of the buffer passed to the callack is not transferred and remains to this HttpData interface.
| |
| usingContent | back to summary |
|---|---|
| public <E extends Exception> void usingContent(Helpers. Calls the passed callback to operate on the file item as a Buffer. Note this method will allocate a lot of memory, if the data is currently stored on the file system. Buffer ownersip: The ownership of the buffer passed to the callack is not transferred and remains to this HttpData interface.
| |