Class InputStreamRequestEntity

  • All Implemented Interfaces:
    RequestEntity

    @Deprecated
    public class InputStreamRequestEntity
    extends java.lang.Object
    implements RequestEntity
    Deprecated.
    Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.
    A RequestEntity that contains an InputStream.
    Since:
    3.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int CONTENT_LENGTH_AUTO
      Deprecated.
      The content length will be calculated automatically.
    • Constructor Summary

      Constructors 
      Constructor Description
      InputStreamRequestEntity​(java.io.InputStream content)
      Deprecated.
      Creates a new InputStreamRequestEntity with the given content and a content type of CONTENT_LENGTH_AUTO.
      InputStreamRequestEntity​(java.io.InputStream content, long contentLength)
      Deprecated.
      Creates a new InputStreamRequestEntity with the given content and content length.
      InputStreamRequestEntity​(java.io.InputStream content, long contentLength, java.lang.String contentType)
      Deprecated.
      Creates a new InputStreamRequestEntity with the given content, content length, and content type.
      InputStreamRequestEntity​(java.io.InputStream content, java.lang.String contentType)
      Deprecated.
      Creates a new InputStreamRequestEntity with the given content, content type, and a content length of CONTENT_LENGTH_AUTO.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.io.InputStream getContent()
      Deprecated.
       
      long getContentLength()
      Deprecated.
      Gets the content length.
      java.lang.String getContentType()
      Deprecated.
      Gets the entity's content type.
      boolean isRepeatable()
      Deprecated.
      Tests if this method is repeatable.
      void writeRequest​(java.io.OutputStream out)
      Deprecated.
      Writes the request entity to the given stream.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CONTENT_LENGTH_AUTO

        public static final int CONTENT_LENGTH_AUTO
        Deprecated.
        The content length will be calculated automatically. This implies buffering of the content.
        See Also:
        Constant Field Values
    • Constructor Detail

      • InputStreamRequestEntity

        public InputStreamRequestEntity​(java.io.InputStream content)
        Deprecated.
        Creates a new InputStreamRequestEntity with the given content and a content type of CONTENT_LENGTH_AUTO.
        Parameters:
        content - The content to set.
      • InputStreamRequestEntity

        public InputStreamRequestEntity​(java.io.InputStream content,
                                        java.lang.String contentType)
        Deprecated.
        Creates a new InputStreamRequestEntity with the given content, content type, and a content length of CONTENT_LENGTH_AUTO.
        Parameters:
        content - The content to set.
        contentType - The type of the content, or null.
      • InputStreamRequestEntity

        public InputStreamRequestEntity​(java.io.InputStream content,
                                        long contentLength)
        Deprecated.
        Creates a new InputStreamRequestEntity with the given content and content length.
        Parameters:
        content - The content to set.
        contentLength - The content size in bytes or a negative number if not known. If CONTENT_LENGTH_AUTO is given the content will be buffered in order to determine its size when getContentLength() is called.
      • InputStreamRequestEntity

        public InputStreamRequestEntity​(java.io.InputStream content,
                                        long contentLength,
                                        java.lang.String contentType)
        Deprecated.
        Creates a new InputStreamRequestEntity with the given content, content length, and content type.
        Parameters:
        content - The content to set.
        contentLength - The content size in bytes or a negative number if not known. If CONTENT_LENGTH_AUTO is given the content will be buffered in order to determine its size when getContentLength() is called.
        contentType - The type of the content, or null.
    • Method Detail

      • isRepeatable

        public boolean isRepeatable()
        Deprecated.
        Tests if this method is repeatable. Only true if the content has been buffered.
        Specified by:
        isRepeatable in interface RequestEntity
        Returns:
        true if the entity can be written to OutputStream more than once, false otherwise.
        See Also:
        getContentLength()
      • writeRequest

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

        public long getContentLength()
        Deprecated.
        Gets the content length. If the content length has not been set, the content will be buffered to determine the actual content length.
        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
      • getContent

        public java.io.InputStream getContent()
        Deprecated.
        Returns:
        Returns the content.