public class MixedAttribute extends java.lang.Object implements Attribute
InterfaceHttpData.HttpDataType| 构造器和说明 |
|---|
MixedAttribute(java.lang.String name,
long limitSize) |
MixedAttribute(java.lang.String name,
java.lang.String value,
long limitSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addContent(ByteBuf buffer,
boolean last)
Add the content from the ChannelBuffer
|
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. |
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() |
InterfaceHttpData.HttpDataType |
getHttpDataType() |
java.lang.String |
getName()
Returns the name of this InterfaceHttpData.
|
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.
|
java.lang.String |
getValue()
Returns the value of this HttpData.
|
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(java.io.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(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 |
setValue(java.lang.String value)
Sets the value of this HttpData.
|
java.lang.String |
toString() |
public MixedAttribute(java.lang.String name,
long limitSize)
public MixedAttribute(java.lang.String name,
java.lang.String value,
long limitSize)
public void addContent(ByteBuf buffer, boolean last) throws java.io.IOException
HttpDataaddContent 在接口中 HttpDatabuffer - must be not null except if last is set to Falselast - True of the buffer is the last onejava.io.IOExceptionpublic void delete()
HttpDatapublic byte[] get()
throws java.io.IOException
HttpDatapublic ByteBuf getByteBuf() throws java.io.IOException
HttpDatagetByteBuf 在接口中 HttpDatajava.io.IOExceptionpublic java.nio.charset.Charset getCharset()
HttpDatagetCharset 在接口中 HttpDatapublic java.lang.String getString()
throws java.io.IOException
HttpDatapublic java.lang.String getString(java.nio.charset.Charset encoding)
throws java.io.IOException
HttpDatapublic boolean isCompleted()
isCompleted 在接口中 HttpDatapublic boolean isInMemory()
HttpDataisInMemory 在接口中 HttpDatapublic long length()
HttpDatapublic boolean renameTo(java.io.File dest)
throws java.io.IOException
HttpDatapublic void setCharset(java.nio.charset.Charset charset)
HttpDatasetCharset 在接口中 HttpDatacharset - Charset to set - must be not nullpublic void setContent(ByteBuf buffer) throws java.io.IOException
HttpDatasetContent 在接口中 HttpDatabuffer - must be not nulljava.io.IOExceptionpublic void setContent(java.io.File file)
throws java.io.IOException
HttpDatasetContent 在接口中 HttpDatafile - must be not nulljava.io.IOExceptionpublic void setContent(java.io.InputStream inputStream)
throws java.io.IOException
HttpDatasetContent 在接口中 HttpDatainputStream - must be not nulljava.io.IOExceptionpublic InterfaceHttpData.HttpDataType getHttpDataType()
getHttpDataType 在接口中 InterfaceHttpDatapublic java.lang.String getName()
InterfaceHttpDatagetName 在接口中 InterfaceHttpDatapublic int compareTo(InterfaceHttpData o)
compareTo 在接口中 java.lang.Comparable<InterfaceHttpData>public java.lang.String toString()
toString 在类中 java.lang.Objectpublic java.lang.String getValue()
throws java.io.IOException
Attributepublic void setValue(java.lang.String value)
throws java.io.IOException
Attributepublic ByteBuf getChunk(int length) throws java.io.IOException
HttpDatapublic java.io.File getFile()
throws java.io.IOException
public Attribute copy()
ByteBufHolderByteBufHolder.public Attribute duplicate()
ByteBufHolderByteBufHolder. Be aware that this will not automatically call ByteBufHolder.retain().public ByteBuf content()
ByteBufHolderByteBufHolder.content 在接口中 ByteBufHolderpublic int refCnt()
ReferenceCounted0, it means this object has been deallocated.refCnt 在接口中 ReferenceCountedpublic Attribute retain()
ReferenceCounted1.retain 在接口中 ByteBufHolderretain 在接口中 Attributeretain 在接口中 HttpDataretain 在接口中 ReferenceCountedpublic Attribute retain(int increment)
ReferenceCountedincrement.retain 在接口中 ByteBufHolderretain 在接口中 Attributeretain 在接口中 HttpDataretain 在接口中 ReferenceCountedpublic boolean release()
ReferenceCounted1 and deallocates this object if the reference count reaches at
0.release 在接口中 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 在接口中 ReferenceCountedtrue if and only if the reference count became 0 and this object has been deallocated