public class MultipartUtility extends Object
Constructor and Description |
---|
MultipartUtility(String requestURL,
String charset,
boolean ignoreSslConnectionErrors)
This constructor initializes a new HTTP POST request with content type is set to
multipart/form-data.
|
Modifier and Type | Method and Description |
---|---|
void |
addFilePart(String fieldName,
File uploadFile,
String workspaceDir)
Adds a upload file section to the request.
|
void |
addFormField(String name,
String value)
Adds a form field to the request.
|
void |
addHeaderField(String name,
String value)
Adds a header field to the request.
|
List<String> |
finish()
Completes the request and receives response from the server.
|
public MultipartUtility(String requestURL, String charset, boolean ignoreSslConnectionErrors) throws IOException
requestURL
- URL for requestcharset
- name of encodingsignoreSslConnectionErrors
- Override Electric Flow SSL Validation CheckIOException
- Exceptionpublic void addFilePart(String fieldName, File uploadFile, String workspaceDir) throws IOException
fieldName
- name attribute in input type="file" name="..."uploadFile
- a File to be uploadedworkspaceDir
- workspace dirIOException
- exceptionpublic void addFormField(String name, String value)
name
- field namevalue
- field valuepublic void addHeaderField(String name, String value)
name
- - name of the header fieldvalue
- - value of the header fieldpublic List<String> finish() throws IOException
IOException
- exceptionCopyright © 2016–2024. All rights reserved.