Interface HttpStreamParam


  • public interface HttpStreamParam
    Defines a parameter to be submitted as part of a multipart/form-data HTTP POST operation.
    Since:
    21 Feb 2011
    Author:
    Mark Taylor
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      long getContentLength()
      Returns the number of bytes that will be written to the output stream, if konwn.
      java.util.Map<java.lang.String,​java.lang.String> getHttpHeaders()
      Returns the headers associated with this parameter.
      void writeContent​(java.io.OutputStream out)
      Writes the data content of this parameter to a stream.
    • Method Detail

      • getHttpHeaders

        java.util.Map<java.lang.String,​java.lang.String> getHttpHeaders()
        Returns the headers associated with this parameter. Note these should generally include the Content-Type unless it is text/plain. The Content-Disposition should not be included.
        Returns:
        name->value HTTP header map
      • writeContent

        void writeContent​(java.io.OutputStream out)
                   throws java.io.IOException
        Writes the data content of this parameter to a stream.
        Parameters:
        out - destination stream
        Throws:
        java.io.IOException
      • getContentLength

        long getContentLength()
        Returns the number of bytes that will be written to the output stream, if konwn. If not known, -1 may be returned.
        Returns:
        content length, or -1 if not known