Class ByteArrayPartSource

  • All Implemented Interfaces:
    PartSource

    @Deprecated
    public class ByteArrayPartSource
    extends java.lang.Object
    implements PartSource
    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 PartSource that reads from a byte array. This class should be used when the data to post is already loaded into memory.
    Since:
    2.0
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteArrayPartSource​(java.lang.String fileName, byte[] bytes)
      Deprecated.
      Constructor for ByteArrayPartSource.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.io.InputStream createInputStream()
      Deprecated.
      Gets a new InputStream for reading this source.
      java.lang.String getFileName()
      Deprecated.
      Gets the name of the file this source represents.
      long getLength()
      Deprecated.
      Gets the number of bytes contained in this source.
      • Methods inherited from class java.lang.Object

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

      • ByteArrayPartSource

        public ByteArrayPartSource​(java.lang.String fileName,
                                   byte[] bytes)
        Deprecated.
        Constructor for ByteArrayPartSource.
        Parameters:
        fileName - the name of the file these bytes represent
        bytes - the content of this part
    • Method Detail

      • getFileName

        public java.lang.String getFileName()
        Deprecated.
        Description copied from interface: PartSource
        Gets the name of the file this source represents.
        Specified by:
        getFileName in interface PartSource
        Returns:
        the fileName used for posting a MultiPart file part
        See Also:
        PartSource.getFileName()
      • createInputStream

        public java.io.InputStream createInputStream()
                                              throws java.io.IOException
        Deprecated.
        Description copied from interface: PartSource
        Gets a new InputStream for reading this source. This method can be called more than once and should therefore return a new stream every time.
        Specified by:
        createInputStream in interface PartSource
        Returns:
        a new InputStream
        Throws:
        java.io.IOException - if an error occurs when creating the InputStream
        See Also:
        PartSource.createInputStream()