public class MixedFileUpload extends AbstractReferenceCounted implements FileUpload
InterfaceHttpData.HttpDataType| 构造器和说明 |
|---|
MixedFileUpload(java.lang.String name,
java.lang.String filename,
java.lang.String contentType,
java.lang.String contentTransferEncoding,
java.nio.charset.Charset charset,
long size,
long limitSize) |
MixedFileUpload(java.lang.String name,
java.lang.String filename,
java.lang.String contentType,
java.lang.String contentTransferEncoding,
java.nio.charset.Charset charset,
long size,
long limitSize,
java.lang.String baseDir,
boolean deleteOnExit) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addContent(ByteBuf buffer,
boolean last)
Add the content from the ChannelBuffer
ReferenceCounted.release() ownership of buffer is transferred to this HttpData. |
void |
checkSize(long newSize)
Check if the new size is not reaching the max limit allowed.
|
int |
compareTo(InterfaceHttpData o) |
ByteBuf |
content()
Return the data which is held by this
ByteBufHolder. |
FileUpload |
copy()
Creates a deep copy of this
ByteBufHolder. |
protected void |
deallocate()
Called once
AbstractReferenceCounted.refCnt() is equals 0. |
long |
definedLength()
Returns the defined length of the HttpData.
|
void |
delete()
Deletes the underlying storage for a file item, including deleting any
associated temporary disk file.
|
FileUpload |
duplicate()
Duplicates this
ByteBufHolder. |
boolean |
equals(java.lang.Object obj) |
byte[] |
get()
Returns the contents of the file item as an array of bytes.
|
ByteBuf |
getByteBuf()
Returns the content of the file item as a ByteBuf.
|
java.nio.charset.Charset |
getCharset()
Returns the Charset passed by the browser or null if not defined.
|
ByteBuf |
getChunk(int length)
Returns a ChannelBuffer for the content from the current position with at
most length read bytes, increasing the current position of the Bytes
read.
|
java.lang.String |
getContentTransferEncoding()
Returns the Content-Transfer-Encoding
|
java.lang.String |
getContentType()
Returns the content type passed by the browser or null if not defined.
|
java.io.File |
getFile() |
java.lang.String |
getFilename()
Returns the original filename in the client's filesystem,
as provided by the browser (or other client software).
|
InterfaceHttpData.HttpDataType |
getHttpDataType() |
long |
getMaxSize()
Returns the maxSize for this HttpData.
|
java.lang.String |
getName()
Returns the name of this InterfaceHttpData.
|
java.lang.String |
getString()
Returns the contents of the file item as a String, using the default
character encoding.
|
java.lang.String |
getString(java.nio.charset.Charset encoding)
Returns the contents of the file item as a String, using the specified
charset.
|
int |
hashCode() |
boolean |
isCompleted() |
boolean |
isInMemory()
Provides a hint as to whether or not the file contents will be read from
memory.
|
long |
length()
Returns the size in byte of the InterfaceHttpData
|
boolean |
renameTo(java.io.File dest)
A convenience getMethod to write an uploaded item to disk.
|
FileUpload |
replace(ByteBuf content)
Returns a new
ByteBufHolder which contains the specified content. |
FileUpload |
retain()
Increases the reference count by
1. |
FileUpload |
retain(int increment)
Increases the reference count by the specified
increment. |
FileUpload |
retainedDuplicate()
Duplicates this
ByteBufHolder. |
void |
setCharset(java.nio.charset.Charset charset)
Set the Charset passed by the browser if defined
|
void |
setContent(ByteBuf buffer)
Set the content from the ChannelBuffer (erase any previous data)
ReferenceCounted.release() ownership of buffer is transferred to this HttpData. |
void |
setContent(java.io.File file)
Set the content from the file (erase any previous data)
|
void |
setContent(java.io.InputStream inputStream)
Set the content from the inputStream (erase any previous data)
|
void |
setContentTransferEncoding(java.lang.String contentTransferEncoding)
Set the Content-Transfer-Encoding type from String as 7bit, 8bit or binary
|
void |
setContentType(java.lang.String contentType)
Set the Content Type passed by the browser if defined
|
void |
setFilename(java.lang.String filename)
Set the original filename
|
void |
setMaxSize(long maxSize)
Set the maxSize for this HttpData.
|
java.lang.String |
toString() |
FileUpload |
touch()
Records the current access location of this object for debugging purposes.
|
FileUpload |
touch(java.lang.Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
refCnt, release, release, setRefCntaddContent, checkSize, definedLength, delete, get, getByteBuf, getCharset, getChunk, getFile, getMaxSize, getString, getString, isCompleted, isInMemory, length, renameTo, setCharset, setContent, setContent, setContent, setMaxSizegetHttpDataType, getNamecontentrefCnt, release, releasepublic MixedFileUpload(java.lang.String name,
java.lang.String filename,
java.lang.String contentType,
java.lang.String contentTransferEncoding,
java.nio.charset.Charset charset,
long size,
long limitSize)
public MixedFileUpload(java.lang.String name,
java.lang.String filename,
java.lang.String contentType,
java.lang.String contentTransferEncoding,
java.nio.charset.Charset charset,
long size,
long limitSize,
java.lang.String baseDir,
boolean deleteOnExit)
public java.lang.String getContentTransferEncoding()
FileUploadgetContentTransferEncoding 在接口中 FileUploadpublic java.lang.String getFilename()
FileUploadgetFilename 在接口中 FileUploadpublic void setContentTransferEncoding(java.lang.String contentTransferEncoding)
FileUploadsetContentTransferEncoding 在接口中 FileUploadpublic void setFilename(java.lang.String filename)
FileUploadsetFilename 在接口中 FileUploadpublic void setContentType(java.lang.String contentType)
FileUploadsetContentType 在接口中 FileUploadcontentType - Content Type to set - must be not nullpublic java.lang.String getContentType()
FileUploadgetContentType 在接口中 FileUploadpublic FileUpload copy()
ByteBufHolderByteBufHolder.copy 在接口中 ByteBufHoldercopy 在接口中 FileUploadcopy 在接口中 HttpDatapublic FileUpload duplicate()
ByteBufHolderByteBufHolder. Be aware that this will not automatically call ByteBufHolder.retain().duplicate 在接口中 ByteBufHolderduplicate 在接口中 FileUploadduplicate 在接口中 HttpDatapublic FileUpload retainedDuplicate()
ByteBufHolderByteBufHolder. This method returns a retained duplicate unlike ByteBufHolder.duplicate().retainedDuplicate 在接口中 ByteBufHolderretainedDuplicate 在接口中 FileUploadretainedDuplicate 在接口中 HttpDataByteBuf.retainedDuplicate()public FileUpload replace(ByteBuf content)
ByteBufHolderByteBufHolder which contains the specified content.replace 在接口中 ByteBufHolderreplace 在接口中 FileUploadreplace 在接口中 HttpDatapublic FileUpload touch()
ReferenceCountedResourceLeakDetector. This method is a shortcut to touch(null).touch 在接口中 ByteBufHoldertouch 在接口中 FileUploadtouch 在接口中 HttpDatatouch 在接口中 InterfaceHttpDatatouch 在接口中 ReferenceCountedpublic FileUpload touch(java.lang.Object hint)
ReferenceCountedResourceLeakDetector.touch 在接口中 ByteBufHoldertouch 在接口中 FileUploadtouch 在接口中 HttpDatatouch 在接口中 InterfaceHttpDatatouch 在接口中 ReferenceCountedpublic FileUpload retain()
ReferenceCounted1.retain 在接口中 ByteBufHolderretain 在接口中 FileUploadretain 在接口中 HttpDataretain 在接口中 InterfaceHttpDataretain 在接口中 ReferenceCountedpublic FileUpload retain(int increment)
ReferenceCountedincrement.retain 在接口中 ByteBufHolderretain 在接口中 FileUploadretain 在接口中 HttpDataretain 在接口中 InterfaceHttpDataretain 在接口中 ReferenceCountedpublic long getMaxSize()
HttpDatagetMaxSize 在接口中 HttpDatapublic void setMaxSize(long maxSize)
HttpDatasetMaxSize 在接口中 HttpDatapublic ByteBuf content()
ByteBufHolderByteBufHolder.content 在接口中 ByteBufHolderpublic void checkSize(long newSize)
throws java.io.IOException
HttpDatapublic long definedLength()
HttpDataFileUpload or any known big Attribute.definedLength 在接口中 HttpDatapublic java.nio.charset.Charset getCharset()
HttpDatagetCharset 在接口中 HttpDatapublic java.lang.String getName()
InterfaceHttpDatagetName 在接口中 InterfaceHttpDatapublic void addContent(ByteBuf buffer, boolean last) throws java.io.IOException
HttpDataReferenceCounted.release() ownership of buffer is transferred to this HttpData.
addContent 在接口中 HttpDatabuffer - must be not null except if last is set to Falselast - True of the buffer is the last onejava.io.IOExceptionprotected void deallocate()
AbstractReferenceCountedAbstractReferenceCounted.refCnt() is equals 0.deallocate 在类中 AbstractReferenceCountedpublic void delete()
HttpDatapublic byte[] get()
throws java.io.IOException
HttpDatapublic ByteBuf getByteBuf() throws java.io.IOException
HttpDatagetByteBuf 在接口中 HttpDatajava.io.IOExceptionpublic java.lang.String getString()
throws java.io.IOException
HttpDatapublic java.lang.String getString(java.nio.charset.Charset encoding)
throws java.io.IOException
HttpDatapublic boolean isInMemory()
HttpDataisInMemory 在接口中 HttpDatapublic long length()
HttpDatapublic boolean renameTo(java.io.File dest)
throws java.io.IOException
HttpDatapublic void setCharset(java.nio.charset.Charset charset)
HttpDatasetCharset 在接口中 HttpDatacharset - Charset to set - must be not nullpublic void setContent(ByteBuf buffer) throws java.io.IOException
HttpDataReferenceCounted.release() ownership of buffer is transferred to this HttpData.
setContent 在接口中 HttpDatabuffer - must be not nulljava.io.IOExceptionpublic void setContent(java.io.File file)
throws java.io.IOException
HttpDatasetContent 在接口中 HttpDatafile - must be not nulljava.io.IOExceptionpublic void setContent(java.io.InputStream inputStream)
throws java.io.IOException
HttpDatasetContent 在接口中 HttpDatainputStream - must be not nulljava.io.IOExceptionpublic boolean isCompleted()
isCompleted 在接口中 HttpDatapublic InterfaceHttpData.HttpDataType getHttpDataType()
getHttpDataType 在接口中 InterfaceHttpDatapublic int hashCode()
hashCode 在类中 java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals 在类中 java.lang.Objectpublic int compareTo(InterfaceHttpData o)
compareTo 在接口中 java.lang.Comparable<InterfaceHttpData>public java.lang.String toString()
toString 在类中 java.lang.Objectpublic ByteBuf getChunk(int length) throws java.io.IOException
HttpData