Class AbstractHttpData
- java.lang.Object
-
- org.jboss.netty.handler.codec.http.multipart.AbstractHttpData
-
- All Implemented Interfaces:
Comparable<InterfaceHttpData>
,HttpData
,InterfaceHttpData
- Direct Known Subclasses:
AbstractDiskHttpData
,AbstractMemoryHttpData
public abstract class AbstractHttpData extends Object implements HttpData
Abstract HttpData implementation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.netty.handler.codec.http.multipart.InterfaceHttpData
InterfaceHttpData.HttpDataType
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractHttpData(String name, Charset charset, long size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkSize(long newSize)
Check if the new size is not reaching the max limit allowed.Charset
getCharset()
Returns the Charset passed by the browser or null if not defined.String
getName()
Returns the name of this InterfaceHttpData.boolean
isCompleted()
long
length()
Returns the size in byte of the InterfaceHttpDatavoid
setCharset(Charset charset)
Set the Charset passed by the browser if definedvoid
setMaxSize(long maxSize)
Set the maxSize for this HttpData.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.jboss.netty.handler.codec.http.multipart.HttpData
addContent, delete, get, getChannelBuffer, getChunk, getFile, getString, getString, isInMemory, renameTo, setContent, setContent, setContent
-
Methods inherited from interface org.jboss.netty.handler.codec.http.multipart.InterfaceHttpData
getHttpDataType
-
-
-
-
Method Detail
-
setMaxSize
public void setMaxSize(long maxSize)
Description copied from interface:HttpData
Set 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:
setMaxSize
in interfaceHttpData
-
checkSize
public void checkSize(long newSize) throws IOException
Description copied from interface:HttpData
Check if the new size is not reaching the max limit allowed. The limit is always computed in term of bytes.- Specified by:
checkSize
in interfaceHttpData
- Throws:
IOException
-
getName
public String getName()
Description copied from interface:InterfaceHttpData
Returns the name of this InterfaceHttpData.- Specified by:
getName
in interfaceInterfaceHttpData
-
isCompleted
public boolean isCompleted()
- Specified by:
isCompleted
in interfaceHttpData
- Returns:
- True if the InterfaceHttpData is completed (all data are stored)
-
getCharset
public Charset getCharset()
Description copied from interface:HttpData
Returns the Charset passed by the browser or null if not defined.- Specified by:
getCharset
in interfaceHttpData
- Returns:
- the Charset passed by the browser or null if not defined.
-
setCharset
public void setCharset(Charset charset)
Description copied from interface:HttpData
Set the Charset passed by the browser if defined- Specified by:
setCharset
in interfaceHttpData
- Parameters:
charset
- Charset to set - must be not null
-
-