Class MultipartUtility
java.lang.Object
org.jenkinsci.plugins.electricflow.MultipartUtility
-
Constructor Summary
ConstructorDescriptionMultipartUtility
(String requestURL, String charset, boolean ignoreSslConnectionErrors) This constructor initializes a new HTTP POST request with content type is set to multipart/form-data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.finish()
Completes the request and receives response from the server.
-
Constructor Details
-
MultipartUtility
public MultipartUtility(String requestURL, String charset, boolean ignoreSslConnectionErrors) throws IOException This constructor initializes a new HTTP POST request with content type is set to multipart/form-data.- Parameters:
requestURL
- URL for requestcharset
- name of encodingsignoreSslConnectionErrors
- Override Electric Flow SSL Validation Check- Throws:
IOException
- Exception
-
-
Method Details
-
addFilePart
Adds a upload file section to the request.- Parameters:
fieldName
- name attribute in input type="file" name="..."uploadFile
- a File to be uploadedworkspaceDir
- workspace dir- Throws:
IOException
- exception
-
addFormField
Adds a form field to the request.- Parameters:
name
- field namevalue
- field value
-
addHeaderField
Adds a header field to the request.- Parameters:
name
- - name of the header fieldvalue
- - value of the header field
-
finish
Completes the request and receives response from the server.- Returns:
- a list of Strings as response in case the server returned status OK, otherwise an exception is thrown.
- Throws:
IOException
- exception
-