public abstract class AbstractMemoryHttpData extends AbstractHttpData
InterfaceHttpData.HttpDataTypedefinedSize, size| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMemoryHttpData(String name,
Charset charset,
long size) |
| Modifier and Type | Method and Description |
|---|---|
void |
addContent(ByteBuf 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.
|
ByteBuf |
getByteBuf()
Utility to go from a In Memory FileUpload
to a Disk (or another implementation) FileUpload
|
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() |
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 getMethod to write an uploaded item to disk.
|
void |
setContent(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)
|
HttpData |
touch()
Records the current access location of this object for debugging purposes.
|
HttpData |
touch(Object hint)
Records the current access location of this object with an additonal arbitrary information for debugging
purposes.
|
checkSize, content, deallocate, getCharset, getMaxSize, getName, isCompleted, length, retain, retain, setCharset, setCompleted, setMaxSizerefCnt, release, release, setRefCntclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHttpDataTypecompareTorefCnt, release, releasepublic void setContent(ByteBuf buffer) throws IOException
HttpDatabuffer - must be not nullIOExceptionpublic void setContent(InputStream inputStream) throws IOException
HttpDatainputStream - must be not nullIOExceptionpublic void addContent(ByteBuf buffer, boolean last) throws IOException
HttpDatabuffer - must be not null except if last is set to Falselast - True of the buffer is the last oneIOExceptionpublic void setContent(File file) throws IOException
HttpDatafile - must be not nullIOExceptionpublic void delete()
HttpDatapublic byte[] get()
HttpDatapublic String getString()
HttpDatapublic String getString(Charset encoding)
HttpDataencoding - the charset to usepublic ByteBuf getByteBuf()
public ByteBuf getChunk(int length) throws IOException
HttpDataIOExceptionpublic boolean isInMemory()
HttpDatapublic boolean renameTo(File dest) throws IOException
HttpDatadest - destination file - must be not nullIOExceptionpublic File getFile() throws IOException
IOException - if this data is not represented by a filepublic HttpData touch()
ReferenceCountedResourceLeakDetector. This method is a shortcut to touch(null).touch in interface ByteBufHoldertouch in interface HttpDatatouch in interface InterfaceHttpDatatouch in interface ReferenceCountedtouch in class AbstractHttpDatapublic HttpData touch(Object hint)
ReferenceCountedResourceLeakDetector.touch in interface ByteBufHoldertouch in interface HttpDatatouch in interface InterfaceHttpDatatouch in interface ReferenceCountedtouch in class AbstractHttpDataCopyright © 2008–2015 The Netty Project. All rights reserved.