Class InputStreamBodyWithLength

  • All Implemented Interfaces:
    org.apache.http.entity.mime.content.ContentBody, org.apache.http.entity.mime.content.ContentDescriptor

    public class InputStreamBodyWithLength
    extends org.apache.http.entity.mime.content.InputStreamBody
    If we want to upload a file that is a resource in a jar file, the http client expects a content length.
    • Constructor Summary

      Constructors 
      Constructor Description
      InputStreamBodyWithLength​(java.lang.String resourcePath, java.lang.String contentType, java.lang.String fileName)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getContentLength()  
      • Methods inherited from class org.apache.http.entity.mime.content.InputStreamBody

        getFilename, getInputStream, getTransferEncoding, writeTo
      • Methods inherited from class org.apache.http.entity.mime.content.AbstractContentBody

        getCharset, getContentType, getMediaType, getMimeType, getSubType
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InputStreamBodyWithLength

        public InputStreamBodyWithLength​(java.lang.String resourcePath,
                                         java.lang.String contentType,
                                         java.lang.String fileName)
                                  throws ClientException
        Throws:
        ClientException
    • Method Detail

      • getContentLength

        public long getContentLength()
        Specified by:
        getContentLength in interface org.apache.http.entity.mime.content.ContentDescriptor
        Overrides:
        getContentLength in class org.apache.http.entity.mime.content.InputStreamBody