public class MixedAttribute extends AbstractReferenceCounted implements Attribute
InterfaceHttpData.HttpDataType
构造器和说明 |
---|
MixedAttribute(java.lang.String name,
long limitSize) |
MixedAttribute(java.lang.String name,
long limitSize,
java.nio.charset.Charset charset) |
MixedAttribute(java.lang.String name,
long limitSize,
java.nio.charset.Charset charset,
java.lang.String baseDir,
boolean deleteOnExit) |
MixedAttribute(java.lang.String name,
long definedSize,
long limitSize) |
MixedAttribute(java.lang.String name,
long definedSize,
long limitSize,
java.nio.charset.Charset charset) |
MixedAttribute(java.lang.String name,
long definedSize,
long limitSize,
java.nio.charset.Charset charset,
java.lang.String baseDir,
boolean deleteOnExit) |
MixedAttribute(java.lang.String name,
java.lang.String value,
long limitSize) |
MixedAttribute(java.lang.String name,
java.lang.String value,
long limitSize,
java.nio.charset.Charset charset) |
MixedAttribute(java.lang.String name,
java.lang.String value,
long limitSize,
java.nio.charset.Charset charset,
java.lang.String baseDir,
boolean deleteOnExit) |
限定符和类型 | 方法和说明 |
---|---|
void |
addContent(ByteBuf buffer,
boolean last)
Add the content from the ChannelBuffer
ReferenceCounted.release() ownership of buffer is transferred to this HttpData . |
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()
Creates a deep copy of this
ByteBufHolder . |
protected void |
deallocate()
Called once
AbstractReferenceCounted.refCnt() is equals 0. |
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.
|
Attribute |
duplicate()
Duplicates this
ByteBufHolder . |
boolean |
equals(java.lang.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.
|
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() |
long |
getMaxSize()
Returns the maxSize for this HttpData.
|
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.
|
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
|
boolean |
renameTo(java.io.File dest)
A convenience getMethod to write an uploaded item to disk.
|
Attribute |
replace(ByteBuf content)
Returns a new
ByteBufHolder which contains the specified content . |
Attribute |
retain()
Increases the reference count by
1 . |
Attribute |
retain(int increment)
Increases the reference count by the specified
increment . |
Attribute |
retainedDuplicate()
Duplicates this
ByteBufHolder . |
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)
ReferenceCounted.release() ownership of buffer is transferred to this HttpData . |
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 |
setMaxSize(long maxSize)
Set the maxSize for this HttpData.
|
void |
setValue(java.lang.String value)
Sets the value of this HttpData.
|
java.lang.String |
toString() |
Attribute |
touch()
Records the current access location of this object for debugging purposes.
|
Attribute |
touch(java.lang.Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
refCnt, release, release, setRefCnt
addContent, checkSize, definedLength, delete, get, getByteBuf, getCharset, getChunk, getFile, getMaxSize, getString, getString, isCompleted, isInMemory, length, renameTo, setCharset, setContent, setContent, setContent, setMaxSize
getHttpDataType, getName
content
refCnt, release, release
public MixedAttribute(java.lang.String name, long limitSize)
public MixedAttribute(java.lang.String name, long definedSize, long limitSize)
public MixedAttribute(java.lang.String name, long limitSize, java.nio.charset.Charset charset)
public MixedAttribute(java.lang.String name, long limitSize, java.nio.charset.Charset charset, java.lang.String baseDir, boolean deleteOnExit)
public MixedAttribute(java.lang.String name, long definedSize, long limitSize, java.nio.charset.Charset charset)
public MixedAttribute(java.lang.String name, long definedSize, long limitSize, java.nio.charset.Charset charset, java.lang.String baseDir, boolean deleteOnExit)
public MixedAttribute(java.lang.String name, java.lang.String value, long limitSize)
public MixedAttribute(java.lang.String name, java.lang.String value, long limitSize, java.nio.charset.Charset charset)
public MixedAttribute(java.lang.String name, java.lang.String value, long limitSize, java.nio.charset.Charset charset, java.lang.String baseDir, boolean deleteOnExit)
public java.lang.String getValue() throws java.io.IOException
Attribute
public void setValue(java.lang.String value) throws java.io.IOException
Attribute
public Attribute copy()
ByteBufHolder
ByteBufHolder
.public Attribute duplicate()
ByteBufHolder
ByteBufHolder
. Be aware that this will not automatically call ByteBufHolder.retain()
.public Attribute replace(ByteBuf content)
ByteBufHolder
ByteBufHolder
which contains the specified content
.public Attribute retain()
ReferenceCounted
1
.retain
在接口中 ByteBufHolder
retain
在接口中 Attribute
retain
在接口中 HttpData
retain
在接口中 InterfaceHttpData
retain
在接口中 ReferenceCounted
public Attribute retain(int increment)
ReferenceCounted
increment
.retain
在接口中 ByteBufHolder
retain
在接口中 Attribute
retain
在接口中 HttpData
retain
在接口中 InterfaceHttpData
retain
在接口中 ReferenceCounted
public Attribute retainedDuplicate()
ByteBufHolder
ByteBufHolder
. This method returns a retained duplicate unlike ByteBufHolder.duplicate()
.retainedDuplicate
在接口中 ByteBufHolder
retainedDuplicate
在接口中 Attribute
retainedDuplicate
在接口中 HttpData
ByteBuf.retainedDuplicate()
public Attribute touch()
ReferenceCounted
ResourceLeakDetector
. This method is a shortcut to touch(null)
.touch
在接口中 ByteBufHolder
touch
在接口中 Attribute
touch
在接口中 HttpData
touch
在接口中 InterfaceHttpData
touch
在接口中 ReferenceCounted
public Attribute touch(java.lang.Object hint)
ReferenceCounted
ResourceLeakDetector
.touch
在接口中 ByteBufHolder
touch
在接口中 Attribute
touch
在接口中 HttpData
touch
在接口中 InterfaceHttpData
touch
在接口中 ReferenceCounted
public long getMaxSize()
HttpData
getMaxSize
在接口中 HttpData
public void setMaxSize(long maxSize)
HttpData
setMaxSize
在接口中 HttpData
public ByteBuf content()
ByteBufHolder
ByteBufHolder
.content
在接口中 ByteBufHolder
public void checkSize(long newSize) throws java.io.IOException
HttpData
public long definedLength()
HttpData
FileUpload
or any known big Attribute
.definedLength
在接口中 HttpData
public java.nio.charset.Charset getCharset()
HttpData
getCharset
在接口中 HttpData
public java.lang.String getName()
InterfaceHttpData
getName
在接口中 InterfaceHttpData
public void addContent(ByteBuf buffer, boolean last) throws java.io.IOException
HttpData
ReferenceCounted.release()
ownership of buffer
is transferred to this HttpData
.
addContent
在接口中 HttpData
buffer
- must be not null except if last is set to Falselast
- True of the buffer is the last onejava.io.IOException
protected void deallocate()
AbstractReferenceCounted
AbstractReferenceCounted.refCnt()
is equals 0.deallocate
在类中 AbstractReferenceCounted
public void delete()
HttpData
public byte[] get() throws java.io.IOException
HttpData
public ByteBuf getByteBuf() throws java.io.IOException
HttpData
getByteBuf
在接口中 HttpData
java.io.IOException
public java.lang.String getString() throws java.io.IOException
HttpData
public java.lang.String getString(java.nio.charset.Charset encoding) throws java.io.IOException
HttpData
public boolean isInMemory()
HttpData
isInMemory
在接口中 HttpData
public long length()
HttpData
public boolean renameTo(java.io.File dest) throws java.io.IOException
HttpData
public void setCharset(java.nio.charset.Charset charset)
HttpData
setCharset
在接口中 HttpData
charset
- Charset to set - must be not nullpublic void setContent(ByteBuf buffer) throws java.io.IOException
HttpData
ReferenceCounted.release()
ownership of buffer
is transferred to this HttpData
.
setContent
在接口中 HttpData
buffer
- must be not nulljava.io.IOException
public void setContent(java.io.File file) throws java.io.IOException
HttpData
setContent
在接口中 HttpData
file
- must be not nulljava.io.IOException
public void setContent(java.io.InputStream inputStream) throws java.io.IOException
HttpData
setContent
在接口中 HttpData
inputStream
- must be not nulljava.io.IOException
public boolean isCompleted()
isCompleted
在接口中 HttpData
public InterfaceHttpData.HttpDataType getHttpDataType()
getHttpDataType
在接口中 InterfaceHttpData
public int hashCode()
hashCode
在类中 java.lang.Object
public boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
public int compareTo(InterfaceHttpData o)
compareTo
在接口中 java.lang.Comparable<InterfaceHttpData>
public java.lang.String toString()
toString
在类中 java.lang.Object
public ByteBuf getChunk(int length) throws java.io.IOException
HttpData