com.jalios.rest.client.multipart
Class HttpClientFormMultipartRepresentation

java.lang.Object
  extended by org.restlet.resource.Variant
      extended by org.restlet.resource.Representation
          extended by com.jalios.rest.client.multipart.HttpClientFormMultipartRepresentation

public class HttpClientFormMultipartRepresentation
extends org.restlet.resource.Representation

Restlet Representation for a Form Multipart request. Based on HttpClient MultipartRequestEntity (it is a wrapper).

Since:
JCMS-6.1
Author:
dissert

Field Summary
 
Fields inherited from class org.restlet.resource.Variant
UNKNOWN_SIZE
 
Constructor Summary
HttpClientFormMultipartRepresentation(List<MultipartParameter> multipartContent)
           
 
Method Summary
 ReadableByteChannel getChannel()
           
 long getSize()
           
 InputStream getStream()
           
 String getText()
          Converts the representation to a string value.
 void write(OutputStream outputStream)
          Writes the representation to a byte stream.
 void write(WritableByteChannel writableChannel)
           
 
Methods inherited from class org.restlet.resource.Representation
isAvailable, isTransient, setAvailable, setTransient
 
Methods inherited from class org.restlet.resource.Variant
getCharacterSet, getEncodings, getExpirationDate, getIdentifier, getLanguages, getMediaType, getModificationDate, getTag, setCharacterSet, setExpirationDate, setIdentifier, setIdentifier, setMediaType, setModificationDate, setSize, setTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientFormMultipartRepresentation

public HttpClientFormMultipartRepresentation(List<MultipartParameter> multipartContent)
Method Detail

getSize

public long getSize()
Overrides:
getSize in class org.restlet.resource.Variant
Returns:
The size in bytes.

getStream

public InputStream getStream()
                      throws IOException
Specified by:
getStream in class org.restlet.resource.Representation
Throws:
IOException

getText

public String getText()
               throws IOException
Converts the representation to a string value. Be careful when using this method as the conversion of large content to a string fully stored in memory can result in OutOfMemoryErrors being thrown.

Overrides:
getText in class org.restlet.resource.Representation
Returns:
The representation as a string value.
Throws:
IOException

write

public void write(OutputStream outputStream)
           throws IOException
Writes the representation to a byte stream.

Specified by:
write in class org.restlet.resource.Representation
Parameters:
outputStream - The output stream.
Throws:
IOException

getChannel

public ReadableByteChannel getChannel()
                               throws IOException
Specified by:
getChannel in class org.restlet.resource.Representation
Throws:
IOException

write

public void write(WritableByteChannel writableChannel)
           throws IOException
Specified by:
write in class org.restlet.resource.Representation
Throws:
IOException


Copyright © 2001-2007 Jalios SA. All Rights Reserved.