Package de.xima.fc.http
Class FileBodyBuilder
java.lang.Object
de.xima.fc.http.FileBodyBuilder
- All Implemented Interfaces:
IFileBodyBuilder<FileBodyBuilder>
,IHttpBodyBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Adds the multipart body to the HTTP requests builder and returns the HTTP request builder.void
overrideContentType
(String contentType) Method to override the content typesetFile
(BinaryData data)
-
Constructor Details
-
FileBodyBuilder
-
-
Method Details
-
setFile
- Specified by:
setFile
in interfaceIFileBodyBuilder<FileBodyBuilder>
- Parameters:
data
- The file whose content should be sent as request body- Returns:
- This builder for chaining method calls.
-
build
Description copied from interface:IHttpBodyBuilder
Adds the multipart body to the HTTP requests builder and returns the HTTP request builder.- Specified by:
build
in interfaceIHttpBodyBuilder
- Returns:
- The HTTP request builder that was used to create this body builder.
-
overrideContentType
public void overrideContentType(String contentType) throws org.apache.http.ParseException, UnsupportedCharsetException Description copied from interface:IFileBodyBuilder
Method to override the content type- Specified by:
overrideContentType
in interfaceIFileBodyBuilder<FileBodyBuilder>
- Parameters:
contentType
- The content type to set- Throws:
org.apache.http.ParseException
- On errors while parsing the content typeUnsupportedCharsetException
- On errors while parsing the charset for the content type
-