Class FileBody
java.lang.Object
org.apache.hc.client5.http.entity.mime.AbstractContentBody
org.apache.hc.client5.http.entity.mime.FileBody
- All Implemented Interfaces:
ContentBody
,ContentDescriptor
Binary body part backed by a file.
- Since:
- 4.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the body descriptors content-length.getFile()
void
writeTo
(OutputStream out) Methods inherited from class org.apache.hc.client5.http.entity.mime.AbstractContentBody
getCharset, getContentType, getMediaType, getMimeType, getSubType
-
Field Details
-
file
-
filename
-
-
Constructor Details
-
FileBody
-
FileBody
- Since:
- 4.3
-
FileBody
- Since:
- 4.3
-
-
Method Details
-
getInputStream
- Throws:
IOException
-
writeTo
- Throws:
IOException
-
getContentLength
public long getContentLength()Description copied from interface:ContentDescriptor
Returns the body descriptors content-length.- Returns:
- Content length, if known, or -1, to indicate the absence of a content-length header.
-
getFilename
-
getFile
-