Class AbstractHttpData
java.lang.Object
io.netty.util.AbstractReferenceCounted
io.netty.handler.codec.http.multipart.AbstractHttpData
- All Implemented Interfaces:
ByteBufHolder, HttpData, InterfaceHttpData, ReferenceCounted, Comparable<InterfaceHttpData>
- Direct Known Subclasses:
AbstractDiskHttpData, AbstractMemoryHttpData
Abstract HttpData implementation
-
Nested Class Summary
Nested classes/interfaces inherited from interface InterfaceHttpData
InterfaceHttpData.HttpDataType -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractHttpData(String name, Charset charset, long size) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckSize(long newSize) Check if the new size is not reaching the max limit allowed.content()Return the data which is held by thisByteBufHolder.protected voidCalled onceAbstractReferenceCounted.refCnt()is equals 0.longReturns the defined length of the HttpData.Returns the Charset passed by the browser or null if not defined.longReturns the maxSize for this HttpData.getName()Returns the name of this InterfaceHttpData.booleanlonglength()Returns the size in byte of the InterfaceHttpDataretain()Increases the reference count by1.retain(int increment) Increases the reference count by the specifiedincrement.voidsetCharset(Charset charset) Set the Charset passed by the browser if definedprotected voidprotected voidsetCompleted(boolean completed) voidsetMaxSize(long maxSize) Set the maxSize for this HttpData.abstract HttpDatatouch()Records the current access location of this object for debugging purposes.abstract HttpDataRecords the current access location of this object with an additional arbitrary information for debugging purposes.Methods inherited from class AbstractReferenceCounted
refCnt, release, release, setRefCntMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparable
compareToMethods inherited from interface HttpData
addContent, copy, delete, duplicate, get, getByteBuf, getChunk, getFile, getString, getString, isInMemory, renameTo, replace, retainedDuplicate, setContent, setContent, setContentMethods inherited from interface InterfaceHttpData
getHttpDataTypeMethods inherited from interface ReferenceCounted
refCnt, release, release
-
Field Details
-
definedSize
protected long definedSize -
size
protected long size
-
-
Constructor Details
-
AbstractHttpData
-
-
Method Details
-
getMaxSize
public long getMaxSize()Description copied from interface:HttpDataReturns the maxSize for this HttpData.- Specified by:
getMaxSizein interfaceHttpData
-
setMaxSize
public void setMaxSize(long maxSize) Description copied from interface:HttpDataSet the maxSize for this HttpData. When limit will be reached, an exception will be raised. Setting it to (-1) means no limitation. By default, to be set from the HttpDataFactory.- Specified by:
setMaxSizein interfaceHttpData
-
checkSize
Description copied from interface:HttpDataCheck if the new size is not reaching the max limit allowed. The limit is always computed in terms of bytes.- Specified by:
checkSizein interfaceHttpData- Throws:
IOException
-
getName
Description copied from interface:InterfaceHttpDataReturns the name of this InterfaceHttpData.- Specified by:
getNamein interfaceInterfaceHttpData
-
isCompleted
public boolean isCompleted()- Specified by:
isCompletedin interfaceHttpData- Returns:
- True if the InterfaceHttpData is completed (all data are stored)
-
setCompleted
protected void setCompleted() -
setCompleted
protected void setCompleted(boolean completed) -
getCharset
Description copied from interface:HttpDataReturns the Charset passed by the browser or null if not defined.- Specified by:
getCharsetin interfaceHttpData- Returns:
- the Charset passed by the browser or null if not defined.
-
setCharset
Description copied from interface:HttpDataSet the Charset passed by the browser if defined- Specified by:
setCharsetin interfaceHttpData- Parameters:
charset- Charset to set - must be not null
-
length
-
definedLength
public long definedLength()Description copied from interface:HttpDataReturns the defined length of the HttpData. If no Content-Length is provided in the request, the defined length is always 0 (whatever during decoding or in final state). If Content-Length is provided in the request, this is this given defined length. This value does not change, whatever during decoding or in the final state. This method could be used for instance to know the amount of bytes transmitted for one particular HttpData, for example oneFileUploador any known bigAttribute.- Specified by:
definedLengthin interfaceHttpData- Returns:
- the defined length of the HttpData
-
content
Description copied from interface:ByteBufHolderReturn the data which is held by thisByteBufHolder.- Specified by:
contentin interfaceByteBufHolder
-
deallocate
protected void deallocate()Description copied from class:AbstractReferenceCountedCalled onceAbstractReferenceCounted.refCnt()is equals 0.- Specified by:
deallocatein classAbstractReferenceCounted
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceHttpData- Specified by:
retainin interfaceInterfaceHttpData- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceByteBufHolder- Specified by:
retainin interfaceHttpData- Specified by:
retainin interfaceInterfaceHttpData- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
touch
Description copied from interface:ReferenceCountedRecords the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceHttpData- Specified by:
touchin interfaceInterfaceHttpData- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classAbstractReferenceCounted
-
touch
Description copied from interface:ReferenceCountedRecords the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector.- Specified by:
touchin interfaceByteBufHolder- Specified by:
touchin interfaceHttpData- Specified by:
touchin interfaceInterfaceHttpData- Specified by:
touchin interfaceReferenceCounted
-