public interface JenkinsHttpConnection extends Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
get(String path)
Perform a GET request and parse the response and return a simple string
of the content
|
<T extends BaseModel> |
get(String path,
Class<T> cls)
Perform a GET request and parse the response to the given class
|
InputStream |
getFile(URI path)
Perform a GET request and return the response as InputStream
|
String |
getJenkinsVersion()
Get the Jenkins server version.
|
<T extends BaseModel> |
getQuietly(String path,
Class<T> cls)
Perform a GET request and parse the response to the given class, logging
any IOException that is thrown rather than propagating it.
|
boolean |
isJenkinsVersionSet()
Check to see if the Jenkins version has been set to something different
than the initialisation value from the constructor.
|
org.apache.http.HttpResponse |
post_form_with_result(String path,
List<org.apache.http.NameValuePair> data,
boolean crumbFlag)
Perform a POST request using form url encoding and return HttpResponse
object This method is not performing validation and can be used for more
generic queries to jenkins.
|
void |
post_form(String path,
Map<String,String> data,
boolean crumbFlag)
Perform a POST request using form url encoding.
|
String |
post_text(String path,
String textData,
boolean crumbFlag)
Post a text entity to the given URL using the default content type
|
String |
post_text(String path,
String textData,
org.apache.http.entity.ContentType contentType,
boolean crumbFlag)
Post a text entity to the given URL with the given content type
|
String |
post_xml(String path,
String xml_data)
Perform a POST request of XML (instead of using json mapper) and return a
string rendering of the response entity.
|
String |
post_xml(String path,
String xml_data,
boolean crumbFlag)
Perform a POST request of XML (instead of using json mapper) and return a
string rendering of the response entity.
|
void |
post(String path)
Perform POST request that takes no parameters and returns no response
|
void |
post(String path,
boolean crumbFlag)
Perform POST request that takes no parameters and returns no response
|
<R extends BaseModel,D> |
post(String path,
D data,
Class<R> cls)
Perform a POST request and parse the response to the given class
|
<R extends BaseModel,D> |
post(String path,
D data,
Class<R> cls,
boolean crumbFlag)
Perform a POST request and parse the response to the given class
|
<R extends BaseModel,D> |
post(String path,
D data,
Class<R> cls,
Map<String,File> fileParams,
boolean crumbFlag)
Perform a POST request and parse the response to the given class
|
void close()
close in interface AutoCloseableclose in interface Closeable<T extends BaseModel> T get(String path, Class<T> cls) throws IOException
T - type of the responsepath - path to request, can be relative or absolutecls - class of the responseIOException - in case of an error.String get(String path) throws IOException
path - path to request, can be relative or absoluteIOException - in case of an error.InputStream getFile(URI path) throws IOException
path - path to request, can be relative or absoluteIOException - in case of an error.<T extends BaseModel> T getQuietly(String path, Class<T> cls)
T - type of the responsepath - path to request, can be relative or absolutecls - class of the responseboolean isJenkinsVersionSet()
<R extends BaseModel,D> R post(String path, D data, Class<R> cls) throws IOException
R - type of the responseD - type of the datapath - path to request, can be relative or absolutedata - data to postcls - class of the responseIOException - in case of an error.<R extends BaseModel,D> R post(String path, D data, Class<R> cls, boolean crumbFlag) throws IOException
R - type of the responseD - type of the datapath - path to request, can be relative or absolutedata - data to postcls - class of the responsecrumbFlag - true / false.IOException - in case of an error.<R extends BaseModel,D> R post(String path, D data, Class<R> cls, Map<String,File> fileParams, boolean crumbFlag) throws IOException
R - type of the responseD - type of the datapath - path to request, can be relative or absolutedata - data to postcls - class of the responsefileParams - file parameterscrumbFlag - true / false.IOException - in case of an error.void post(String path) throws IOException
path - path to requestIOException - in case of an error.void post(String path, boolean crumbFlag) throws IOException
path - path to requestcrumbFlag - true / false.IOException - in case of an error.void post_form(String path, Map<String,String> data, boolean crumbFlag) throws IOException
path - path to request, can be relative or absolutedata - data to postcrumbFlag - true / false.IOException - in case of an error.org.apache.http.HttpResponse post_form_with_result(String path, List<org.apache.http.NameValuePair> data, boolean crumbFlag) throws IOException
path - path to request, can be relative or absolutedata - data to postcrumbFlag - true / false.IOException - in case of an error.String post_text(String path, String textData, boolean crumbFlag) throws IOException
path - The path.textData - data.crumbFlag - true/false.IOException - in case of an error.String post_text(String path, String textData, org.apache.http.entity.ContentType contentType, boolean crumbFlag) throws IOException
path - The path.textData - The data.contentType - ContentTypecrumbFlag - true or false.IOException - in case of an error.String post_xml(String path, String xml_data) throws IOException
path - path to request, can be relative or absolutexml_data - data data to postIOException - in case of an error.String post_xml(String path, String xml_data, boolean crumbFlag) throws IOException
path - path to request, can be relative or absolutexml_data - data data to postcrumbFlag - true or false.IOException - in case of an error.String getJenkinsVersion()
Copyright © 2018. All rights reserved.