public class MixedAttribute extends io.netty.util.AbstractReferenceCounted implements Attribute
InterfaceHttpData.HttpDataType| Constructor and Description |
|---|
MixedAttribute(String name,
long limitSize) |
MixedAttribute(String name,
long limitSize,
Charset charset) |
MixedAttribute(String name,
long limitSize,
Charset charset,
String baseDir,
boolean deleteOnExit) |
MixedAttribute(String name,
long definedSize,
long limitSize) |
MixedAttribute(String name,
long definedSize,
long limitSize,
Charset charset) |
MixedAttribute(String name,
long definedSize,
long limitSize,
Charset charset,
String baseDir,
boolean deleteOnExit) |
MixedAttribute(String name,
String value,
long limitSize) |
MixedAttribute(String name,
String value,
long limitSize,
Charset charset) |
MixedAttribute(String name,
String value,
long limitSize,
Charset charset,
String baseDir,
boolean deleteOnExit) |
| Modifier and Type | Method and Description |
|---|---|
void |
addContent(io.netty.buffer.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) |
io.netty.buffer.ByteBuf |
content() |
Attribute |
copy() |
protected void |
deallocate() |
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() |
boolean |
equals(Object obj) |
byte[] |
get()
Returns the contents of the file item as an array of bytes.
|
io.netty.buffer.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.
|
io.netty.buffer.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
|
boolean |
renameTo(File dest)
A convenience getMethod to write an uploaded item to disk.
|
Attribute |
replace(io.netty.buffer.ByteBuf content) |
Attribute |
retain() |
Attribute |
retain(int increment) |
Attribute |
retainedDuplicate() |
void |
setCharset(Charset charset)
Set the Charset passed by the browser if defined
|
void |
setContent(io.netty.buffer.ByteBuf buffer)
Set the content from the ChannelBuffer (erase any previous data)
ReferenceCounted.release() ownership of buffer is transferred to this HttpData. |
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() |
Attribute |
touch(Object hint) |
refCnt, release, release, setRefCntclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddContent, checkSize, definedLength, delete, get, getByteBuf, getCharset, getChunk, getFile, getMaxSize, getString, getString, isCompleted, isInMemory, length, renameTo, setCharset, setContent, setContent, setContent, setMaxSizegetHttpDataType, getNamecompareTopublic MixedAttribute(String name, long limitSize)
public MixedAttribute(String name, long definedSize, long limitSize)
public MixedAttribute(String name, long limitSize, Charset charset, String baseDir, boolean deleteOnExit)
public MixedAttribute(String name, long definedSize, long limitSize, Charset charset)
public MixedAttribute(String name, long definedSize, long limitSize, Charset charset, String baseDir, boolean deleteOnExit)
public String getValue() throws IOException
AttributegetValue in interface AttributeIOExceptionpublic void setValue(String value) throws IOException
AttributesetValue in interface AttributeIOExceptionpublic Attribute copy()
public Attribute duplicate()
public Attribute replace(io.netty.buffer.ByteBuf content)
public Attribute retain()
public Attribute retain(int increment)
public Attribute retainedDuplicate()
retainedDuplicate in interface io.netty.buffer.ByteBufHolderretainedDuplicate in interface AttributeretainedDuplicate in interface HttpDatapublic Attribute touch()
public long getMaxSize()
HttpDatagetMaxSize in interface HttpDatapublic void setMaxSize(long maxSize)
HttpDatasetMaxSize in interface HttpDatapublic io.netty.buffer.ByteBuf content()
content in interface io.netty.buffer.ByteBufHolderpublic void checkSize(long newSize)
throws IOException
HttpDatacheckSize in interface HttpDataIOExceptionpublic long definedLength()
HttpDataFileUpload or any known big Attribute.definedLength in interface HttpDatapublic Charset getCharset()
HttpDatagetCharset in interface HttpDatapublic String getName()
InterfaceHttpDatagetName in interface InterfaceHttpDatapublic void addContent(io.netty.buffer.ByteBuf buffer,
boolean last)
throws IOException
HttpDataReferenceCounted.release() ownership of buffer is transferred to this HttpData.
addContent in interface HttpDatabuffer - must be not null except if last is set to Falselast - True of the buffer is the last oneIOExceptionprotected void deallocate()
deallocate in class io.netty.util.AbstractReferenceCountedpublic void delete()
HttpDatapublic byte[] get()
throws IOException
HttpDataget in interface HttpDataIOExceptionpublic io.netty.buffer.ByteBuf getByteBuf()
throws IOException
HttpDatagetByteBuf in interface HttpDataIOExceptionpublic String getString() throws IOException
HttpDatagetString in interface HttpDataIOExceptionpublic String getString(Charset encoding) throws IOException
HttpDatagetString in interface HttpDataencoding - the charset to useIOExceptionpublic 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(io.netty.buffer.ByteBuf buffer)
throws IOException
HttpDataReferenceCounted.release() ownership of buffer is transferred to this HttpData.
setContent 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 boolean isCompleted()
isCompleted in interface HttpDatapublic InterfaceHttpData.HttpDataType getHttpDataType()
getHttpDataType in interface InterfaceHttpDatapublic int compareTo(InterfaceHttpData o)
compareTo in interface Comparable<InterfaceHttpData>public io.netty.buffer.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 fileCopyright © 2008–2024 The Netty Project. All rights reserved.