public class MixedFileUpload extends AbstractReferenceCounted implements FileUpload
InterfaceHttpData.HttpDataType| Constructor and Description |
|---|
MixedFileUpload(String name,
String filename,
String contentType,
String contentTransferEncoding,
Charset charset,
long size,
long limitSize) |
MixedFileUpload(String name,
String filename,
String contentType,
String contentTransferEncoding,
Charset charset,
long size,
long limitSize,
String baseDir,
boolean deleteOnExit) |
| Modifier and Type | Method and Description |
|---|---|
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(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.
|
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.
|
String |
getContentTransferEncoding()
Returns the Content-Transfer-Encoding
|
String |
getContentType()
Returns the content type passed by the browser or null if not defined.
|
File |
getFile() |
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.
|
String |
getName()
Returns the name of this InterfaceHttpData.
|
String |
getString()
Returns the contents of the file item as a String, using the default
character encoding.
|
String |
getString(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(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(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(File file)
Set the content from the file (erase any previous data)
|
void |
setContent(InputStream inputStream)
Set the content from the inputStream (erase any previous data)
|
void |
setContentTransferEncoding(String contentTransferEncoding)
Set the Content-Transfer-Encoding type from String as 7bit, 8bit or binary
|
void |
setContentType(String contentType)
Set the Content Type passed by the browser if defined
|
void |
setFilename(String filename)
Set the original filename
|
void |
setMaxSize(long maxSize)
Set the maxSize for this HttpData.
|
String |
toString() |
FileUpload |
touch()
Records the current access location of this object for debugging purposes.
|
FileUpload |
touch(Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
refCnt, release, release, setRefCntclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddContent, checkSize, definedLength, delete, get, getByteBuf, getCharset, getChunk, getFile, getMaxSize, getString, getString, isCompleted, isInMemory, length, renameTo, setCharset, setContent, setContent, setContent, setMaxSizegetHttpDataType, getNamecompareTocontentrefCnt, release, releasepublic MixedFileUpload(String name, String filename, String contentType, String contentTransferEncoding, Charset charset, long size, long limitSize)
public String getContentTransferEncoding()
FileUploadgetContentTransferEncoding in interface FileUploadpublic String getFilename()
FileUploadgetFilename in interface FileUploadpublic void setContentTransferEncoding(String contentTransferEncoding)
FileUploadsetContentTransferEncoding in interface FileUploadpublic void setFilename(String filename)
FileUploadsetFilename in interface FileUploadpublic void setContentType(String contentType)
FileUploadsetContentType in interface FileUploadcontentType - Content Type to set - must be not nullpublic String getContentType()
FileUploadgetContentType in interface FileUploadpublic FileUpload copy()
ByteBufHolderByteBufHolder.copy in interface ByteBufHoldercopy in interface FileUploadcopy in interface HttpDatapublic FileUpload duplicate()
ByteBufHolderByteBufHolder. Be aware that this will not automatically call ByteBufHolder.retain().duplicate in interface ByteBufHolderduplicate in interface FileUploadduplicate in interface HttpDatapublic FileUpload retainedDuplicate()
ByteBufHolderByteBufHolder. This method returns a retained duplicate unlike ByteBufHolder.duplicate().retainedDuplicate in interface ByteBufHolderretainedDuplicate in interface FileUploadretainedDuplicate in interface HttpDataByteBuf.retainedDuplicate()public FileUpload replace(ByteBuf content)
ByteBufHolderByteBufHolder which contains the specified content.replace in interface ByteBufHolderreplace in interface FileUploadreplace in interface HttpDatapublic FileUpload touch()
ReferenceCountedResourceLeakDetector. This method is a shortcut to touch(null).touch in interface ByteBufHoldertouch in interface FileUploadtouch in interface HttpDatatouch in interface InterfaceHttpDatatouch in interface ReferenceCountedpublic FileUpload touch(Object hint)
ReferenceCountedResourceLeakDetector.touch in interface ByteBufHoldertouch in interface FileUploadtouch in interface HttpDatatouch in interface InterfaceHttpDatatouch in interface ReferenceCountedpublic FileUpload retain()
ReferenceCounted1.retain in interface ByteBufHolderretain in interface FileUploadretain in interface HttpDataretain in interface InterfaceHttpDataretain in interface ReferenceCountedpublic FileUpload retain(int increment)
ReferenceCountedincrement.retain in interface ByteBufHolderretain in interface FileUploadretain in interface HttpDataretain in interface InterfaceHttpDataretain in interface ReferenceCountedpublic long getMaxSize()
HttpDatagetMaxSize in interface HttpDatapublic void setMaxSize(long maxSize)
HttpDatasetMaxSize in interface HttpDatapublic ByteBuf content()
ByteBufHolderByteBufHolder.content in interface ByteBufHolderpublic void checkSize(long newSize)
throws IOException
HttpDatacheckSize in interface HttpDataIOExceptionpublic long definedLength()
HttpDataFileUpload or any known big Attribute.definedLength in interface HttpDatapublic Charset getCharset()
HttpDatagetCharset in interface HttpDatapublic String getName()
InterfaceHttpDatagetName in interface InterfaceHttpDatapublic void addContent(ByteBuf buffer, boolean last) throws IOException
HttpDataReferenceCounted.release() ownership of buffer is transferred to this HttpData.
addContent in interface HttpDatabuffer - must be not null except if last is set to Falselast - True of the buffer is the last oneIOExceptionprotected void deallocate()
AbstractReferenceCountedAbstractReferenceCounted.refCnt() is equals 0.deallocate in class AbstractReferenceCountedpublic void delete()
HttpDatapublic byte[] get()
throws IOException
HttpDataget in interface HttpDataIOExceptionpublic ByteBuf getByteBuf() throws IOException
HttpDatagetByteBuf in interface HttpDataIOExceptionpublic String getString() throws IOException
HttpDatagetString in interface HttpDataIOExceptionpublic String getString(Charset encoding) throws IOException
HttpDatagetString in interface HttpDataencoding - the charset to useIOExceptionpublic boolean isInMemory()
HttpDataisInMemory in interface HttpDatapublic long length()
HttpDatapublic boolean renameTo(File dest) throws IOException
HttpDatarenameTo in interface HttpDatadest - destination file - must be not nullIOExceptionpublic void setCharset(Charset charset)
HttpDatasetCharset in interface HttpDatacharset - Charset to set - must be not nullpublic void setContent(ByteBuf buffer) throws IOException
HttpDataReferenceCounted.release() ownership of buffer is transferred to this HttpData.
setContent in interface HttpDatabuffer - must be not nullIOExceptionpublic void setContent(File file) throws IOException
HttpDatasetContent in interface HttpDatafile - must be not nullIOExceptionpublic void setContent(InputStream inputStream) throws IOException
HttpDatasetContent in interface HttpDatainputStream - must be not nullIOExceptionpublic boolean isCompleted()
isCompleted in interface HttpDatapublic InterfaceHttpData.HttpDataType getHttpDataType()
getHttpDataType in interface InterfaceHttpDatapublic int compareTo(InterfaceHttpData o)
compareTo in interface Comparable<InterfaceHttpData>public ByteBuf getChunk(int length) throws IOException
HttpDatagetChunk in interface HttpDataIOExceptionpublic File getFile() throws IOException
getFile in interface HttpDataIOException - if this data is not represented by a fileCopyright © 2008–2025 The Netty Project. All rights reserved.