|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.netty.handler.codec.http2.MixedFileUpload
public class MixedFileUpload

Mixed implementation using both in Memory and in File with a limit of size
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jboss.netty.handler.codec.http2.InterfaceHttpData |
|---|
InterfaceHttpData.HttpDataType |
| Constructor Summary | |
|---|---|
MixedFileUpload(String name,
String filename,
String contentType,
String contentTransferEncoding,
Charset charset,
long size,
long limitSize)
|
|
| Method Summary | |
|---|---|
void |
addContent(org.jboss.netty.buffer.ChannelBuffer buffer,
boolean last)
Add the content from the ChannelBuffer |
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. |
org.jboss.netty.buffer.ChannelBuffer |
getChannelBuffer()
Returns the content of the file item as a ChannelBuffer |
Charset |
getCharset()
Returns the Charset passed by the browser or null if not defined. |
org.jboss.netty.buffer.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. |
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()
|
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. |
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 method to write an uploaded item to disk. |
void |
setCharset(Charset charset)
Set the Charset passed by the browser if defined |
void |
setContent(org.jboss.netty.buffer.ChannelBuffer buffer)
Set the content from the ChannelBuffer (erase any previous data) |
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 |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MixedFileUpload(String name,
String filename,
String contentType,
String contentTransferEncoding,
Charset charset,
long size,
long limitSize)
throws NullPointerException,
IllegalArgumentException
NullPointerException
IllegalArgumentException| Method Detail |
|---|
public void addContent(org.jboss.netty.buffer.ChannelBuffer buffer,
boolean last)
throws IOException
HttpData
addContent in interface HttpDatabuffer - must be not null except if last is set to Falselast - True of the buffer is the last one
IOExceptionpublic void delete()
HttpData
delete in interface HttpData
public byte[] get()
throws IOException
HttpData
get in interface HttpDataIOException
public org.jboss.netty.buffer.ChannelBuffer getChannelBuffer()
throws IOException
HttpData
getChannelBuffer in interface HttpDataIOExceptionpublic Charset getCharset()
HttpData
getCharset in interface HttpDatapublic String getContentType()
FileUpload
getContentType in interface FileUploadpublic String getContentTransferEncoding()
FileUpload
getContentTransferEncoding in interface FileUploadpublic String getFilename()
FileUpload
getFilename in interface FileUpload
public String getString()
throws IOException
HttpData
getString in interface HttpDataIOException
public String getString(Charset encoding)
throws IOException
HttpData
getString in interface HttpDataencoding - the charset to use
IOExceptionpublic boolean isCompleted()
isCompleted in interface HttpDatapublic boolean isInMemory()
HttpData
isInMemory in interface HttpDatapublic long length()
HttpData
length in interface HttpData
public boolean renameTo(File dest)
throws IOException
HttpData
renameTo in interface HttpDatadest - destination file - must be not null
IOExceptionpublic void setCharset(Charset charset)
HttpData
setCharset in interface HttpDatacharset - Charset to set - must be not null
public void setContent(org.jboss.netty.buffer.ChannelBuffer buffer)
throws IOException
HttpData
setContent in interface HttpDatabuffer - must be not null
IOException
public void setContent(File file)
throws IOException
HttpData
setContent in interface HttpDatafile - must be not null
IOException
public void setContent(InputStream inputStream)
throws IOException
HttpData
setContent in interface HttpDatainputStream - must be not null
IOExceptionpublic void setContentType(String contentType)
FileUpload
setContentType in interface FileUploadcontentType - Content Type to set - must be not nullpublic void setContentTransferEncoding(String contentTransferEncoding)
FileUpload
setContentTransferEncoding in interface FileUploadpublic void setFilename(String filename)
FileUpload
setFilename in interface FileUploadpublic InterfaceHttpData.HttpDataType getHttpDataType()
getHttpDataType in interface InterfaceHttpDatapublic String getName()
InterfaceHttpData
getName in interface InterfaceHttpDatapublic int compareTo(InterfaceHttpData o)
compareTo in interface Comparable<InterfaceHttpData>public String toString()
toString in class Object
public org.jboss.netty.buffer.ChannelBuffer getChunk(int length)
throws IOException
HttpData
getChunk in interface HttpDataIOException
public File getFile()
throws IOException
getFile in interface HttpDataIOException - if this data is not represented by a file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||