Class FileRequestEntity

  • All Implemented Interfaces:
    RequestEntity

    public class FileRequestEntity
    extends java.lang.Object
    implements RequestEntity
    A RequestEntity that represents a File.
    Since:
    3.1
    • Constructor Detail

      • FileRequestEntity

        public FileRequestEntity​(java.io.File file,
                                 java.lang.String contentType)
    • Method Detail

      • getContentLength

        public long getContentLength()
        Description copied from interface: RequestEntity
        Gets the request entity's length. This method should return a non-negative value if the content length is known or a negative value if it is not. In the latter case the EntityEnclosingMethod will use chunk encoding to transmit the request entity.
        Specified by:
        getContentLength in interface RequestEntity
        Returns:
        a non-negative value when content length is known or a negative value when content length is not known
      • writeRequest

        public void writeRequest​(java.io.OutputStream out)
                          throws java.io.IOException
        Description copied from interface: RequestEntity
        Writes the request entity to the given stream.
        Specified by:
        writeRequest in interface RequestEntity
        Throws:
        java.io.IOException