public class MixedFileUpload extends java.lang.Object implements FileUpload
InterfaceHttpData.HttpDataType
限定符和类型 | 字段和说明 |
---|---|
protected long |
maxSize |
构造器和说明 |
---|
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) |
限定符和类型 | 方法和说明 |
---|---|
void |
addContent(ChannelBuffer buffer,
boolean last)
Add the content from the ChannelBuffer
|
void |
checkSize(long newSize)
Check if the new size is not reaching the max limit allowed.
|
int |
compareTo(InterfaceHttpData o) |
void |
delete()
Deletes the underlying storage for a file item, including deleting any
associated temporary disk file.
|
byte[] |
get()
Returns the contents of the file item as an array of bytes.
|
ChannelBuffer |
getChannelBuffer()
Returns the content of the file item as a ChannelBuffer
|
java.nio.charset.Charset |
getCharset()
Returns the Charset passed by the browser or null if not defined.
|
ChannelBuffer |
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() |
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.
|
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 method to write an uploaded item to disk.
|
void |
setCharset(java.nio.charset.Charset charset)
Set the Charset passed by the browser if defined
|
void |
setContent(ChannelBuffer buffer)
Set the content from the ChannelBuffer (erase any previous data)
|
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() |
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)
public void setMaxSize(long maxSize)
HttpData
setMaxSize
在接口中 HttpData
public void checkSize(long newSize) throws java.io.IOException
HttpData
public void addContent(ChannelBuffer buffer, boolean last) throws java.io.IOException
HttpData
addContent
在接口中 HttpData
buffer
- must be not null except if last is set to Falselast
- True of the buffer is the last onejava.io.IOException
public void delete()
HttpData
public byte[] get() throws java.io.IOException
HttpData
public ChannelBuffer getChannelBuffer() throws java.io.IOException
HttpData
getChannelBuffer
在接口中 HttpData
java.io.IOException
public java.nio.charset.Charset getCharset()
HttpData
getCharset
在接口中 HttpData
public java.lang.String getContentType()
FileUpload
getContentType
在接口中 FileUpload
public java.lang.String getContentTransferEncoding()
FileUpload
getContentTransferEncoding
在接口中 FileUpload
public java.lang.String getFilename()
FileUpload
getFilename
在接口中 FileUpload
public java.lang.String getString() throws java.io.IOException
HttpData
public java.lang.String getString(java.nio.charset.Charset encoding) throws java.io.IOException
HttpData
public boolean isCompleted()
isCompleted
在接口中 HttpData
public boolean isInMemory()
HttpData
isInMemory
在接口中 HttpData
public long length()
HttpData
public boolean renameTo(java.io.File dest) throws java.io.IOException
HttpData
public void setCharset(java.nio.charset.Charset charset)
HttpData
setCharset
在接口中 HttpData
charset
- Charset to set - must be not nullpublic void setContent(ChannelBuffer buffer) throws java.io.IOException
HttpData
setContent
在接口中 HttpData
buffer
- must be not nulljava.io.IOException
public void setContent(java.io.File file) throws java.io.IOException
HttpData
setContent
在接口中 HttpData
file
- must be not nulljava.io.IOException
public void setContent(java.io.InputStream inputStream) throws java.io.IOException
HttpData
setContent
在接口中 HttpData
inputStream
- must be not nulljava.io.IOException
public void setContentType(java.lang.String contentType)
FileUpload
setContentType
在接口中 FileUpload
contentType
- Content Type to set - must be not nullpublic void setContentTransferEncoding(java.lang.String contentTransferEncoding)
FileUpload
setContentTransferEncoding
在接口中 FileUpload
public void setFilename(java.lang.String filename)
FileUpload
setFilename
在接口中 FileUpload
public InterfaceHttpData.HttpDataType getHttpDataType()
getHttpDataType
在接口中 InterfaceHttpData
public java.lang.String getName()
InterfaceHttpData
getName
在接口中 InterfaceHttpData
public int compareTo(InterfaceHttpData o)
compareTo
在接口中 java.lang.Comparable<InterfaceHttpData>
public java.lang.String toString()
toString
在类中 java.lang.Object
public ChannelBuffer getChunk(int length) throws java.io.IOException
HttpData