Top Fields Constructors Methods
io.netty.handler.codec.http.multipart

pack-priv abstract Class AbstractMixedHttpData<D extends io.netty.handler.codec.http.multipart.HttpData>

extends AbstractReferenceCounted
implements HttpData
Class Inheritance
All Implemented Interfaces
io.netty.handler.codec.http.multipart.HttpData, io.netty.buffer.ByteBufHolder, io.netty.util.ReferenceCounted, io.netty.handler.codec.http.multipart.InterfaceHttpData, java.lang.Comparable
Known Direct Subclasses
io.netty.handler.codec.http.multipart.MixedAttribute, io.netty.handler.codec.http.multipart.MixedFileUpload
Imports
io.netty.buffer.ByteBuf, io.netty.util.AbstractReferenceCounted, java.io.File, .IOException, .InputStream, java.nio.charset.Charset

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv final boolean
private final long
pack-priv D

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractMixedHttpData(long limitSize, String baseDir, boolean deleteOnExit, D initial)

Method Summary

Modifier and TypeMethod and Description
public void
addContent(ByteBuf
must be not null except if last is set to False
buffer
,
boolean
True of the buffer is the last one
last
)

Implements io.netty.handler.codec.http.multipart.HttpData.addContent.

Add the content from the ChannelBuffer

ByteBuf#release() ownership of buffer is transferred to this HttpData.

public void
checkSize(long newSize)

Implements io.netty.handler.codec.http.multipart.HttpData.checkSize.

Check if the new size is not reaching the max limit allowed.
public int
compareTo(InterfaceHttpData
the object to be compared.
o
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.
public ByteBuf
content()

Implements io.netty.buffer.ByteBufHolder.content.

Return the data which is held by this ByteBufHolder.
public D
protected void
deallocate()

Implements abstract io.netty.util.AbstractReferenceCounted.deallocate.

Called once refCnt() is equals 0.
public long
definedLength()

Implements io.netty.handler.codec.http.multipart.HttpData.definedLength.

Returns the defined length of the HttpData.
public void
delete()

Implements io.netty.handler.codec.http.multipart.HttpData.delete.

Deletes the underlying storage for a file item, including deleting any associated temporary disk file.
public D
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public byte[]
get()

Implements io.netty.handler.codec.http.multipart.HttpData.get.

Returns the contents of the file item as an array of bytes.
public ByteBuf
getByteBuf()

Implements io.netty.handler.codec.http.multipart.HttpData.getByteBuf.

Returns the content of the file item as a ByteBuf.
public Charset
getCharset()

Implements io.netty.handler.codec.http.multipart.HttpData.getCharset.

Returns the Charset passed by the browser or null if not defined.
public ByteBuf
getChunk(int length)

Implements io.netty.handler.codec.http.multipart.HttpData.getChunk.

Returns a ChannelBuffer for the content from the current position with at most length read bytes, increasing the current position of the Bytes read.
public File
public InterfaceHttpData.HttpDataType
public long
getMaxSize()

Implements io.netty.handler.codec.http.multipart.HttpData.getMaxSize.

Returns the maxSize for this HttpData.
public String
getName()

Implements io.netty.handler.codec.http.multipart.InterfaceHttpData.getName.

Returns the name of this InterfaceHttpData.
public String
getString()

Implements io.netty.handler.codec.http.multipart.HttpData.getString.

Returns the contents of the file item as a String, using the default character encoding.
public String
getString(Charset
the charset to use
encoding
)

Implements io.netty.handler.codec.http.multipart.HttpData.getString.

Returns the contents of the file item as a String, using the specified charset.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
public boolean
isInMemory()

Implements io.netty.handler.codec.http.multipart.HttpData.isInMemory.

Provides a hint as to whether or not the file contents will be read from memory.
public long
length()

Implements io.netty.handler.codec.http.multipart.HttpData.length.

Returns the size in byte of the InterfaceHttpData
pack-priv abstract D
public boolean
renameTo(File
destination file - must be not null
dest
)

Implements io.netty.handler.codec.http.multipart.HttpData.renameTo.

A convenience getMethod to write an uploaded item to disk.
public D
replace(ByteBuf content)

Implements io.netty.handler.codec.http.multipart.HttpData.replace.

Returns a new ByteBufHolder which contains the specified content.
public D
public D
retain(int increment)

Overrides io.netty.util.AbstractReferenceCounted.retain.

Implements io.netty.handler.codec.http.multipart.HttpData.retain, io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.
public D
public void
setCharset(Charset
Charset to set - must be not null
charset
)

Implements io.netty.handler.codec.http.multipart.HttpData.setCharset.

Set the Charset passed by the browser if defined
public void
setContent(ByteBuf
must be not null
buffer
)

Implements io.netty.handler.codec.http.multipart.HttpData.setContent.

Set the content from the ChannelBuffer (erase any previous data)

ByteBuf#release() ownership of buffer is transferred to this HttpData.

public void
setContent(File
must be not null
file
)

Implements io.netty.handler.codec.http.multipart.HttpData.setContent.

Set the content from the file (erase any previous data)
public void
setContent(InputStream
must be not null
inputStream
)

Implements io.netty.handler.codec.http.multipart.HttpData.setContent.

Set the content from the inputStream (erase any previous data)
public void
setMaxSize(long maxSize)

Implements io.netty.handler.codec.http.multipart.HttpData.setMaxSize.

Set the maxSize for this HttpData.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public D
touch()

Overrides io.netty.util.AbstractReferenceCounted.touch.

Implements io.netty.handler.codec.http.multipart.HttpData.touch, io.netty.util.ReferenceCounted.touch.

Records the current access location of this object for debugging purposes.
public D
touch(Object hint)

Implements io.netty.handler.codec.http.multipart.HttpData.touch, io.netty.util.ReferenceCounted.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
Inherited from io.netty.util.AbstractReferenceCounted:
refCntreleasereleasesetRefCnt

Field Detail

baseDirback to summary
pack-priv final String baseDir
deleteOnExitback to summary
pack-priv final boolean deleteOnExit
limitSizeback to summary
private final long limitSize
wrappedback to summary
pack-priv D wrapped

Constructor Detail

AbstractMixedHttpDataback to summary
pack-priv AbstractMixedHttpData(long limitSize, String baseDir, boolean deleteOnExit, D initial)

Method Detail

addContentback to summary
public void addContent(ByteBuf buffer, boolean last) throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.addContent.

Doc from io.netty.handler.codec.http.multipart.HttpData.addContent.

Add the content from the ChannelBuffer

ByteBuf#release() ownership of buffer is transferred to this HttpData.

Parameters
buffer:ByteBuf

must be not null except if last is set to False

last:boolean

True of the buffer is the last one

Annotations
@Override
checkSizeback to summary
public void checkSize(long newSize) throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.checkSize.

Doc from io.netty.handler.codec.http.multipart.HttpData.checkSize.

Check if the new size is not reaching the max limit allowed. The limit is always computed in terms of bytes.

Annotations
@Override
compareToback to summary
public int compareTo(InterfaceHttpData o)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
o:InterfaceHttpData

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
contentback to summary
public ByteBuf content()

Implements io.netty.buffer.ByteBufHolder.content.

Doc from io.netty.buffer.ByteBufHolder.content.

Return the data which is held by this ByteBufHolder.

Annotations
@Override
copyback to summary
public D copy()

Implements io.netty.handler.codec.http.multipart.HttpData.copy.

Doc from io.netty.buffer.ByteBufHolder.copy.

Creates a deep copy of this ByteBufHolder.

Annotations
@SuppressWarnings:unchecked
@Override
deallocateback to summary
protected void deallocate()

Implements abstract io.netty.util.AbstractReferenceCounted.deallocate.

Doc from io.netty.util.AbstractReferenceCounted.deallocate.

Called once refCnt() is equals 0.

Annotations
@Override
definedLengthback to summary
public long definedLength()

Implements io.netty.handler.codec.http.multipart.HttpData.definedLength.

Doc from io.netty.handler.codec.http.multipart.HttpData.definedLength.

Returns 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 one FileUpload or any known big Attribute.

Returns:long

the defined length of the HttpData

Annotations
@Override
deleteback to summary
public void delete()

Implements io.netty.handler.codec.http.multipart.HttpData.delete.

Doc from io.netty.handler.codec.http.multipart.HttpData.delete.

Deletes the underlying storage for a file item, including deleting any associated temporary disk file.

Annotations
@Override
duplicateback to summary
public D duplicate()

Implements io.netty.handler.codec.http.multipart.HttpData.duplicate.

Doc from io.netty.buffer.ByteBufHolder.duplicate.

Duplicates this ByteBufHolder. Be aware that this will not automatically call retain().

Annotations
@SuppressWarnings:unchecked
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getback to summary
public byte[] get() throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.get.

Doc from io.netty.handler.codec.http.multipart.HttpData.get.

Returns the contents of the file item as an array of bytes.

Note

this method will allocate a lot of memory, if the data is currently stored on the file system.

Returns:byte[]

the contents of the file item as an array of bytes.

Annotations
@Override
getByteBufback to summary
public ByteBuf getByteBuf() throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.getByteBuf.

Doc from io.netty.handler.codec.http.multipart.HttpData.getByteBuf.

Returns the content of the file item as a ByteBuf.

Note

this method will allocate a lot of memory, if the data is currently stored on the file system.

Returns:ByteBuf

the content of the file item as a ByteBuf

Annotations
@Override
getCharsetback to summary
public Charset getCharset()

Implements io.netty.handler.codec.http.multipart.HttpData.getCharset.

Doc from io.netty.handler.codec.http.multipart.HttpData.getCharset.

Returns the Charset passed by the browser or null if not defined.

Returns:Charset

the Charset passed by the browser or null if not defined.

Annotations
@Override
getChunkback to summary
public ByteBuf getChunk(int length) throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.getChunk.

Doc from io.netty.handler.codec.http.multipart.HttpData.getChunk.

Returns a ChannelBuffer for the content from the current position with at most length read bytes, increasing the current position of the Bytes read. Once it arrives at the end, it returns an EMPTY_BUFFER and it resets the current position to 0.

Returns:ByteBuf

a ChannelBuffer for the content from the current position or an EMPTY_BUFFER if there is no more data to return

Annotations
@Override
getFileback to summary
public File getFile() throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.getFile.

Returns:File

Doc from io.netty.handler.codec.http.multipart.HttpData.getFile.

the associated File if this data is represented in a file

Annotations
@Override
Exceptions
IOException:

Doc from io.netty.handler.codec.http.multipart.HttpData.getFile.

if this data is not represented by a file

getHttpDataTypeback to summary
public InterfaceHttpData.HttpDataType getHttpDataType()

Implements io.netty.handler.codec.http.multipart.InterfaceHttpData.getHttpDataType.

Returns:InterfaceHttpData.HttpDataType

Doc from io.netty.handler.codec.http.multipart.InterfaceHttpData.getHttpDataType.

The HttpDataType

Annotations
@Override
getMaxSizeback to summary
public long getMaxSize()

Implements io.netty.handler.codec.http.multipart.HttpData.getMaxSize.

Doc from io.netty.handler.codec.http.multipart.HttpData.getMaxSize.

Returns the maxSize for this HttpData.

Annotations
@Override
getNameback to summary
public String getName()

Implements io.netty.handler.codec.http.multipart.InterfaceHttpData.getName.

Doc from io.netty.handler.codec.http.multipart.InterfaceHttpData.getName.

Returns the name of this InterfaceHttpData.

Annotations
@Override
getStringback to summary
public String getString() throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.getString.

Doc from io.netty.handler.codec.http.multipart.HttpData.getString.

Returns the contents of the file item as a String, using the default character encoding.

Returns:String

the contents of the file item as a String, using the default character encoding.

Annotations
@Override
getStringback to summary
public String getString(Charset encoding) throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.getString.

Doc from io.netty.handler.codec.http.multipart.HttpData.getString.

Returns the contents of the file item as a String, using the specified charset.

Parameters
encoding:Charset

the charset to use

Returns:String

the contents of the file item as a String, using the specified charset.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isCompletedback to summary
public boolean isCompleted()

Implements io.netty.handler.codec.http.multipart.HttpData.isCompleted.

Returns:boolean

Doc from io.netty.handler.codec.http.multipart.HttpData.isCompleted.

True if the InterfaceHttpData is completed (all data are stored)

Annotations
@Override
isInMemoryback to summary
public boolean isInMemory()

Implements io.netty.handler.codec.http.multipart.HttpData.isInMemory.

Doc from io.netty.handler.codec.http.multipart.HttpData.isInMemory.

Provides a hint as to whether or not the file contents will be read from memory.

Returns:boolean

True if the file contents is in memory.

Annotations
@Override
lengthback to summary
public long length()

Implements io.netty.handler.codec.http.multipart.HttpData.length.

Doc from io.netty.handler.codec.http.multipart.HttpData.length.

Returns the size in byte of the InterfaceHttpData

Returns:long

the size of the InterfaceHttpData

Annotations
@Override
makeDiskDataback to summary
pack-priv abstract D makeDiskData()
renameToback to summary
public boolean renameTo(File dest) throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.renameTo.

Doc from io.netty.handler.codec.http.multipart.HttpData.renameTo.

A convenience getMethod to write an uploaded item to disk. If a previous one exists, it will be deleted. Once this getMethod is called, if successful, the new file will be out of the cleaner of the factory that creates the original InterfaceHttpData object.

Parameters
dest:File

destination file - must be not null

Returns:boolean

True if the write is successful

Annotations
@Override
replaceback to summary
public D replace(ByteBuf content)

Implements io.netty.handler.codec.http.multipart.HttpData.replace.

Doc from io.netty.buffer.ByteBufHolder.replace.

Returns a new ByteBufHolder which contains the specified content.

Annotations
@SuppressWarnings:unchecked
@Override
retainback to summary
public D retain()

Overrides io.netty.util.AbstractReferenceCounted.retain.

Implements io.netty.handler.codec.http.multipart.HttpData.retain, io.netty.util.ReferenceCounted.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by 1.

Annotations
@SuppressWarnings:unchecked
@Override
retainback to summary
public D retain(int increment)

Overrides io.netty.util.AbstractReferenceCounted.retain.

Implements io.netty.handler.codec.http.multipart.HttpData.retain, io.netty.util.ReferenceCounted.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.

Annotations
@SuppressWarnings:unchecked
@Override
retainedDuplicateback to summary
public D retainedDuplicate()

Implements io.netty.handler.codec.http.multipart.HttpData.retainedDuplicate.

Doc from io.netty.buffer.ByteBufHolder.retainedDuplicate.

Duplicates this ByteBufHolder. This method returns a retained duplicate unlike duplicate().

Annotations
@SuppressWarnings:unchecked
@Override
setCharsetback to summary
public void setCharset(Charset charset)

Implements io.netty.handler.codec.http.multipart.HttpData.setCharset.

Doc from io.netty.handler.codec.http.multipart.HttpData.setCharset.

Set the Charset passed by the browser if defined

Parameters
charset:Charset

Charset to set - must be not null

Annotations
@Override
setContentback to summary
public void setContent(ByteBuf buffer) throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.setContent.

Doc from io.netty.handler.codec.http.multipart.HttpData.setContent.

Set the content from the ChannelBuffer (erase any previous data)

ByteBuf#release() ownership of buffer is transferred to this HttpData.

Parameters
buffer:ByteBuf

must be not null

Annotations
@Override
setContentback to summary
public void setContent(File file) throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.setContent.

Doc from io.netty.handler.codec.http.multipart.HttpData.setContent.

Set the content from the file (erase any previous data)

Parameters
file:File

must be not null

Annotations
@Override
setContentback to summary
public void setContent(InputStream inputStream) throws IOException

Implements io.netty.handler.codec.http.multipart.HttpData.setContent.

Doc from io.netty.handler.codec.http.multipart.HttpData.setContent.

Set the content from the inputStream (erase any previous data)

Parameters
inputStream:InputStream

must be not null

Annotations
@Override
setMaxSizeback to summary
public void setMaxSize(long maxSize)

Implements io.netty.handler.codec.http.multipart.HttpData.setMaxSize.

Doc from io.netty.handler.codec.http.multipart.HttpData.setMaxSize.

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.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
touchback to summary
public D touch()

Overrides io.netty.util.AbstractReferenceCounted.touch.

Implements io.netty.handler.codec.http.multipart.HttpData.touch, io.netty.util.ReferenceCounted.touch.

Doc from io.netty.util.ReferenceCounted.touch.

Records 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 via ResourceLeakDetector. This method is a shortcut to touch(null).

Annotations
@SuppressWarnings:unchecked
@Override
touchback to summary
public D touch(Object hint)

Implements io.netty.handler.codec.http.multipart.HttpData.touch, io.netty.util.ReferenceCounted.touch.

Doc from io.netty.util.ReferenceCounted.touch.

Records 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 via ResourceLeakDetector.

Annotations
@SuppressWarnings:unchecked
@Override