public abstract class AbstractHttpData extends AbstractReferenceCounted implements HttpData
InterfaceHttpData.HttpDataType
Modifier and Type | Field and Description |
---|---|
private java.nio.charset.Charset |
charset |
private boolean |
completed |
protected long |
definedSize |
private long |
maxSize |
private java.lang.String |
name |
private static java.util.regex.Pattern |
REPLACE_PATTERN |
protected long |
size |
private static java.util.regex.Pattern |
STRIP_PATTERN |
Modifier | Constructor and Description |
---|---|
protected |
AbstractHttpData(java.lang.String name,
java.nio.charset.Charset charset,
long size) |
Modifier and Type | Method and Description |
---|---|
void |
checkSize(long newSize)
Check if the new size is not reaching the max limit allowed.
|
ByteBuf |
content()
Return the data which is held by this
ByteBufHolder . |
protected void |
deallocate()
Called once
AbstractReferenceCounted.refCnt() is equals 0. |
long |
definedLength()
Returns the defined length of the HttpData.
|
java.nio.charset.Charset |
getCharset()
Returns the Charset passed by the browser or null if not defined.
|
long |
getMaxSize()
Returns the maxSize for this HttpData.
|
java.lang.String |
getName()
Returns the name of this InterfaceHttpData.
|
boolean |
isCompleted() |
long |
length()
Returns the size in byte of the InterfaceHttpData
|
HttpData |
retain()
Increases the reference count by
1 . |
HttpData |
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
|
protected void |
setCompleted() |
void |
setMaxSize(long maxSize)
Set the maxSize for this HttpData.
|
abstract HttpData |
touch()
Records the current access location of this object for debugging purposes.
|
abstract HttpData |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addContent, copy, delete, duplicate, get, getByteBuf, getChunk, getFile, getString, getString, isInMemory, renameTo, replace, retainedDuplicate, setContent, setContent, setContent
getHttpDataType
refCnt, release, release
private static final java.util.regex.Pattern STRIP_PATTERN
private static final java.util.regex.Pattern REPLACE_PATTERN
private final java.lang.String name
protected long definedSize
protected long size
private java.nio.charset.Charset charset
private boolean completed
private long maxSize
protected AbstractHttpData(java.lang.String name, java.nio.charset.Charset charset, long size)
public long getMaxSize()
HttpData
getMaxSize
in interface HttpData
public void setMaxSize(long maxSize)
HttpData
setMaxSize
in interface HttpData
public void checkSize(long newSize) throws java.io.IOException
HttpData
public java.lang.String getName()
InterfaceHttpData
getName
in interface InterfaceHttpData
public boolean isCompleted()
isCompleted
in interface HttpData
protected void setCompleted()
public java.nio.charset.Charset getCharset()
HttpData
getCharset
in interface HttpData
public void setCharset(java.nio.charset.Charset charset)
HttpData
setCharset
in interface HttpData
charset
- Charset to set - must be not nullpublic long length()
HttpData
public long definedLength()
HttpData
FileUpload
or any known big Attribute
.definedLength
in interface HttpData
public ByteBuf content()
ByteBufHolder
ByteBufHolder
.content
in interface ByteBufHolder
protected void deallocate()
AbstractReferenceCounted
AbstractReferenceCounted.refCnt()
is equals 0.deallocate
in class AbstractReferenceCounted
public HttpData retain()
ReferenceCounted
1
.retain
in interface ByteBufHolder
retain
in interface HttpData
retain
in interface InterfaceHttpData
retain
in interface ReferenceCounted
retain
in class AbstractReferenceCounted
public HttpData retain(int increment)
ReferenceCounted
increment
.retain
in interface ByteBufHolder
retain
in interface HttpData
retain
in interface InterfaceHttpData
retain
in interface ReferenceCounted
retain
in class AbstractReferenceCounted
public abstract HttpData touch()
ReferenceCounted
ResourceLeakDetector
. This method is a shortcut to touch(null)
.touch
in interface ByteBufHolder
touch
in interface HttpData
touch
in interface InterfaceHttpData
touch
in interface ReferenceCounted
touch
in class AbstractReferenceCounted
public abstract HttpData touch(java.lang.Object hint)
ReferenceCounted
ResourceLeakDetector
.touch
in interface ByteBufHolder
touch
in interface HttpData
touch
in interface InterfaceHttpData
touch
in interface ReferenceCounted