Class FilePartSource
java.lang.Object
org.apache.commons.httpclient.methods.multipart.FilePartSource
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionFilePartSource(File file) Deprecated.Constructor for FilePartSource.FilePartSource(String fileName, File file) Deprecated.Constructor for FilePartSource. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Return a newFileInputStreamfor the current filename.Deprecated.Return the current filenamelongDeprecated.Return the length of the file
-
Constructor Details
-
FilePartSource
Deprecated.Constructor for FilePartSource.- Parameters:
file- the FilePart source File.- Throws:
FileNotFoundException- if the file does not exist or cannot be read
-
FilePartSource
Deprecated.Constructor for FilePartSource.- Parameters:
fileName- the file name of the FilePartfile- the source File for the FilePart- Throws:
FileNotFoundException- if the file does not exist or cannot be read
-
-
Method Details
-
getLength
public long getLength()Deprecated.Return the length of the file- Specified by:
getLengthin interfacePartSource- Returns:
- the length of the file.
- See Also:
-
getFileName
Deprecated.Return the current filename- Specified by:
getFileNamein interfacePartSource- Returns:
- the filename.
- See Also:
-
createInputStream
Deprecated.Return a newFileInputStreamfor the current filename.- Specified by:
createInputStreamin interfacePartSource- Returns:
- the new input stream.
- Throws:
IOException- If an IO problem occurs.- See Also:
-