Class AbstractHttpData
- java.lang.Object
-
- org.jboss.netty.handler.codec.http.multipart.AbstractHttpData
-
- All Implemented Interfaces:
java.lang.Comparable<InterfaceHttpData>,HttpData,InterfaceHttpData
- Direct Known Subclasses:
AbstractDiskHttpData,AbstractMemoryHttpData
public abstract class AbstractHttpData extends java.lang.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
-
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.charset.Charsetcharsetprotected booleancompletedprotected longdefinedSizeprotected longmaxSizeprotected java.lang.Stringnameprivate static java.util.regex.PatternREPLACE_PATTERNprotected longsizeprivate static java.util.regex.PatternSTRIP_PATTERN
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractHttpData(java.lang.String name, java.nio.charset.Charset charset, long size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckSize(long newSize)Check if the new size is not reaching the max limit allowed.java.nio.charset.CharsetgetCharset()Returns the Charset passed by the browser or null if not defined.java.lang.StringgetName()Returns the name of this InterfaceHttpData.booleanisCompleted()longlength()Returns the size in byte of the InterfaceHttpDatavoidsetCharset(java.nio.charset.Charset charset)Set the Charset passed by the browser if definedvoidsetMaxSize(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 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
-
-
-
-
Field Detail
-
STRIP_PATTERN
private static final java.util.regex.Pattern STRIP_PATTERN
-
REPLACE_PATTERN
private static final java.util.regex.Pattern REPLACE_PATTERN
-
name
protected final java.lang.String name
-
definedSize
protected long definedSize
-
size
protected long size
-
charset
protected java.nio.charset.Charset charset
-
completed
protected boolean completed
-
maxSize
protected long maxSize
-
-
Method Detail
-
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
public void checkSize(long newSize) throws java.io.IOExceptionDescription copied from interface:HttpDataCheck if the new size is not reaching the max limit allowed. The limit is always computed in term of bytes.
-
getName
public java.lang.String 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)
-
getCharset
public java.nio.charset.Charset 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
public void setCharset(java.nio.charset.Charset charset)
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
-
-