Class ResponseCodeEnforcingResponseHandler
- java.lang.Object
-
- org.apache.sling.maven.bundlesupport.deploy.method.ResponseCodeEnforcingResponseHandler
-
- All Implemented Interfaces:
org.apache.hc.core5.http.io.HttpClientResponseHandler<Integer>
public final class ResponseCodeEnforcingResponseHandler extends Object implements org.apache.hc.core5.http.io.HttpClientResponseHandler<Integer>
ThrowsHttpResponseException
for all response codes except for the accepted ones. In addition optionally checks for a certain content type and content of the response. Returns the response code if all checks pass.
-
-
Constructor Summary
Constructors Constructor Description ResponseCodeEnforcingResponseHandler(Integer... allowedCodes)
ResponseCodeEnforcingResponseHandler(String expectedContentType, Integer... allowedCodes)
ResponseCodeEnforcingResponseHandler(String expectedContentType, Predicate<String> responseStringPredicate, Integer... allowedCodes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
handleResponse(org.apache.hc.core5.http.ClassicHttpResponse response)
-
-
-
Method Detail
-
handleResponse
public Integer handleResponse(org.apache.hc.core5.http.ClassicHttpResponse response) throws org.apache.hc.core5.http.HttpException, IOException
- Specified by:
handleResponse
in interfaceorg.apache.hc.core5.http.io.HttpClientResponseHandler<Integer>
- Throws:
org.apache.hc.core5.http.HttpException
IOException
-
-