Package com.jalios.rest.client.multipart
Class HttpClientFormMultipartRepresentation
- java.lang.Object
-
- org.restlet.resource.Variant
-
- org.restlet.resource.Representation
-
- 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
-
-
Constructor Summary
Constructors Constructor Description HttpClientFormMultipartRepresentation(java.util.List<MultipartParameter> multipartContent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.channels.ReadableByteChannel
getChannel()
long
getSize()
java.io.InputStream
getStream()
java.lang.String
getText()
Converts the representation to a string value.void
write(java.io.OutputStream outputStream)
Writes the representation to a byte stream.void
write(java.nio.channels.WritableByteChannel writableChannel)
-
Methods inherited from class org.restlet.resource.Representation
isAvailable, isTransient, setAvailable, setTransient
-
-
-
-
Constructor Detail
-
HttpClientFormMultipartRepresentation
public HttpClientFormMultipartRepresentation(java.util.List<MultipartParameter> multipartContent)
-
-
Method Detail
-
getSize
public long getSize()
- Overrides:
getSize
in classorg.restlet.resource.Variant
- Returns:
- The size in bytes.
-
getStream
public java.io.InputStream getStream() throws java.io.IOException
- Specified by:
getStream
in classorg.restlet.resource.Representation
- Throws:
java.io.IOException
-
getText
public java.lang.String getText() throws java.io.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 classorg.restlet.resource.Representation
- Returns:
- The representation as a string value.
- Throws:
java.io.IOException
-
write
public void write(java.io.OutputStream outputStream) throws java.io.IOException
Writes the representation to a byte stream.- Specified by:
write
in classorg.restlet.resource.Representation
- Parameters:
outputStream
- The output stream.- Throws:
java.io.IOException
-
getChannel
public java.nio.channels.ReadableByteChannel getChannel() throws java.io.IOException
- Specified by:
getChannel
in classorg.restlet.resource.Representation
- Throws:
java.io.IOException
-
write
public void write(java.nio.channels.WritableByteChannel writableChannel) throws java.io.IOException
- Specified by:
write
in classorg.restlet.resource.Representation
- Throws:
java.io.IOException
-
-