Package de.xima.fc.http
Class FileBodyBuilder
- java.lang.Object
-
- de.xima.fc.http.FileBodyBuilder
-
- All Implemented Interfaces:
IFileBodyBuilder<FileBodyBuilder>
,IHttpBodyBuilder
public class FileBodyBuilder extends Object implements IFileBodyBuilder<FileBodyBuilder>
-
-
Constructor Summary
Constructors Constructor Description FileBodyBuilder(HttpRequestBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpRequestBuilder
build()
Adds the multipart body to the HTTP requests builder and returns the HTTP request builder.void
overrideContentType(String contentType)
Method to override the content typeFileBodyBuilder
setFile(BinaryData data)
-
-
-
Constructor Detail
-
FileBodyBuilder
public FileBodyBuilder(HttpRequestBuilder builder)
-
-
Method Detail
-
setFile
public FileBodyBuilder setFile(BinaryData data)
- 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
public HttpRequestBuilder 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
-
-