Class 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
    • 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
      • 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​(java.util.List<MultipartParameter> multipartContent)
    • Method Detail

      • getSize

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

        public java.io.InputStream getStream()
                                      throws java.io.IOException
        Specified by:
        getStream in class org.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 class org.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 class org.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 class org.restlet.resource.Representation
        Throws:
        java.io.IOException
      • write

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