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>
Throws
HttpResponseException
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
ConstructorsConstructorDescriptionResponseCodeEnforcingResponseHandler
(Integer... allowedCodes) ResponseCodeEnforcingResponseHandler
(String expectedContentType, Integer... allowedCodes) ResponseCodeEnforcingResponseHandler
(String expectedContentType, Predicate<String> responseStringPredicate, Integer... allowedCodes) -
Method Summary
Modifier and TypeMethodDescriptionhandleResponse
(org.apache.hc.core5.http.ClassicHttpResponse response)
-
Constructor Details
-
ResponseCodeEnforcingResponseHandler
-
ResponseCodeEnforcingResponseHandler
-
ResponseCodeEnforcingResponseHandler
-
-
Method Details
-
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
-