Class FilePartSource

  • All Implemented Interfaces:
    PartSource

    @Deprecated
    public class FilePartSource
    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 File.
    Since:
    2.0
    • Constructor Summary

      Constructors 
      Constructor Description
      FilePartSource​(java.io.File file)
      Deprecated.
      Constructor for FilePartSource.
      FilePartSource​(java.lang.String fileName, java.io.File file)
      Deprecated.
      Constructor for FilePartSource.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.io.InputStream createInputStream()
      Deprecated.
      Return a new FileInputStream for the current filename.
      java.lang.String getFileName()
      Deprecated.
      Return the current filename
      long getLength()
      Deprecated.
      Return the length of the file
      • Methods inherited from class java.lang.Object

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

      • FilePartSource

        public FilePartSource​(java.io.File file)
                       throws java.io.FileNotFoundException
        Deprecated.
        Constructor for FilePartSource.
        Parameters:
        file - the FilePart source File.
        Throws:
        java.io.FileNotFoundException - if the file does not exist or cannot be read
      • FilePartSource

        public FilePartSource​(java.lang.String fileName,
                              java.io.File file)
                       throws java.io.FileNotFoundException
        Deprecated.
        Constructor for FilePartSource.
        Parameters:
        fileName - the file name of the FilePart
        file - the source File for the FilePart
        Throws:
        java.io.FileNotFoundException - if the file does not exist or cannot be read
    • Method Detail

      • createInputStream

        public java.io.InputStream createInputStream()
                                              throws java.io.IOException
        Deprecated.
        Return a new FileInputStream for the current filename.
        Specified by:
        createInputStream in interface PartSource
        Returns:
        the new input stream.
        Throws:
        java.io.IOException - If an IO problem occurs.
        See Also:
        PartSource.createInputStream()