public class MixedAttribute extends Object implements Attribute
InterfaceHttpData.HttpDataType| Constructor and Description |
|---|
MixedAttribute(String name,
long limitSize) |
MixedAttribute(String name,
long limitSize,
Charset charset) |
MixedAttribute(String name,
String value,
long limitSize) |
MixedAttribute(String name,
String value,
long limitSize,
Charset charset) |
| 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.
|
int |
compareTo(InterfaceHttpData o) |
ByteBuf |
content()
Return the data which is held by this
ByteBufHolder. |
Attribute |
copy()
Create a deep copy of this
ByteBufHolder. |
void |
delete()
Deletes the underlying storage for a file item, including deleting any
associated temporary disk file.
|
Attribute |
duplicate()
Duplicate the
ByteBufHolder. |
boolean |
equals(Object obj) |
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
|
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.
|
File |
getFile() |
InterfaceHttpData.HttpDataType |
getHttpDataType() |
long |
getMaxSize()
Returns the maxSize for this HttpData.
|
String |
getName()
Returns the name of this InterfaceHttpData.
|
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.
|
String |
getValue()
Returns the value of this HttpData.
|
int |
hashCode() |
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
|
int |
refCnt()
Returns the reference count of this object.
|
boolean |
release()
Decreases the reference count by
1 and deallocates this object if the reference count reaches at
0. |
boolean |
release(int decrement)
Decreases the reference count by the specified
decrement and deallocates this object if the reference
count reaches at 0. |
boolean |
renameTo(File dest)
A convenience getMethod to write an uploaded item to disk.
|
Attribute |
retain()
Increases the reference count by
1. |
Attribute |
retain(int increment)
Increases the reference count by the specified
increment. |
void |
setCharset(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(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.
|
void |
setValue(String value)
Sets the value of this HttpData.
|
String |
toString() |
Attribute |
touch()
Records the current access location of this object for debugging purposes.
|
Attribute |
touch(Object hint)
Records the current access location of this object with an additonal arbitrary information for debugging
purposes.
|
public MixedAttribute(String name, long limitSize)
public long getMaxSize()
HttpDatagetMaxSize in interface HttpDatapublic void setMaxSize(long maxSize)
HttpDatasetMaxSize in interface HttpDatapublic void checkSize(long newSize)
throws IOException
HttpDatacheckSize in interface HttpDataIOExceptionpublic void addContent(ByteBuf buffer, boolean last) throws IOException
HttpDataaddContent in interface HttpDatabuffer - must be not null except if last is set to Falselast - True of the buffer is the last oneIOExceptionpublic void delete()
HttpDatapublic byte[] get()
throws IOException
HttpDataget in interface HttpDataIOExceptionpublic ByteBuf getByteBuf() throws IOException
HttpDatagetByteBuf in interface HttpDataIOExceptionpublic Charset getCharset()
HttpDatagetCharset in interface HttpDatapublic String getString() throws IOException
HttpDatagetString in interface HttpDataIOExceptionpublic String getString(Charset encoding) throws IOException
HttpDatagetString in interface HttpDataencoding - the charset to useIOExceptionpublic boolean isCompleted()
isCompleted in interface HttpDatapublic boolean isInMemory()
HttpDataisInMemory in interface HttpDatapublic long length()
HttpDatapublic boolean renameTo(File dest) throws IOException
HttpDatarenameTo in interface HttpDatadest - destination file - must be not nullIOExceptionpublic void setCharset(Charset charset)
HttpDatasetCharset in interface HttpDatacharset - Charset to set - must be not nullpublic void setContent(ByteBuf buffer) throws IOException
HttpDatasetContent in interface HttpDatabuffer - must be not nullIOExceptionpublic void setContent(File file) throws IOException
HttpDatasetContent in interface HttpDatafile - must be not nullIOExceptionpublic void setContent(InputStream inputStream) throws IOException
HttpDatasetContent in interface HttpDatainputStream - must be not nullIOExceptionpublic InterfaceHttpData.HttpDataType getHttpDataType()
getHttpDataType in interface InterfaceHttpDatapublic String getName()
InterfaceHttpDatagetName in interface InterfaceHttpDatapublic int compareTo(InterfaceHttpData o)
compareTo in interface Comparable<InterfaceHttpData>public String getValue() throws IOException
AttributegetValue in interface AttributeIOExceptionpublic void setValue(String value) throws IOException
AttributesetValue in interface AttributeIOExceptionpublic ByteBuf getChunk(int length) throws IOException
HttpDatagetChunk in interface HttpDataIOExceptionpublic File getFile() throws IOException
getFile in interface HttpDataIOException - if this data is not represented by a filepublic Attribute copy()
ByteBufHolderByteBufHolder.public Attribute duplicate()
ByteBufHolderByteBufHolder. Be aware that this will not automatically call ByteBufHolder.retain().public ByteBuf content()
ByteBufHolderByteBufHolder.content in interface ByteBufHolderpublic int refCnt()
ReferenceCounted0, it means this object has been deallocated.refCnt in interface ReferenceCountedpublic Attribute retain()
ReferenceCounted1.retain in interface ByteBufHolderretain in interface Attributeretain in interface HttpDataretain in interface InterfaceHttpDataretain in interface ReferenceCountedpublic Attribute retain(int increment)
ReferenceCountedincrement.retain in interface ByteBufHolderretain in interface Attributeretain in interface HttpDataretain in interface InterfaceHttpDataretain in interface ReferenceCountedpublic Attribute touch()
ReferenceCountedResourceLeakDetector. This method is a shortcut to touch(null).touch in interface ByteBufHoldertouch in interface Attributetouch in interface HttpDatatouch in interface InterfaceHttpDatatouch in interface ReferenceCountedpublic Attribute touch(Object hint)
ReferenceCountedResourceLeakDetector.touch in interface ByteBufHoldertouch in interface Attributetouch in interface HttpDatatouch in interface InterfaceHttpDatatouch in interface ReferenceCountedpublic boolean release()
ReferenceCounted1 and deallocates this object if the reference count reaches at
0.release in interface ReferenceCountedtrue if and only if the reference count became 0 and this object has been deallocatedpublic boolean release(int decrement)
ReferenceCounteddecrement and deallocates this object if the reference
count reaches at 0.release in interface ReferenceCountedtrue if and only if the reference count became 0 and this object has been deallocatedCopyright © 2008–2015 The Netty Project. All rights reserved.