All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.offbytwo.jenkins.client.validator.HttpResponseValidator Maven / Gradle / Ivy

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