com.offbytwo.jenkins.client.validator.HttpResponseValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jenkins-client Show documentation
Show all versions of jenkins-client Show documentation
A Jenkins API client for Java
package com.offbytwo.jenkins.client.validator;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpResponseException;
public class HttpResponseValidator {
public void validateResponse(HttpResponse response) throws HttpResponseException {
int status = response.getStatusLine().getStatusCode();
if (status < 200 || status >= 400) {
throw new HttpResponseException(status, response.getStatusLine().getReasonPhrase());
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy