use of io.fabric8.maven.docker.access.hc.ApacheHttpClientDelegate.BodyAndStatusResponseHandler in project docker-maven-plugin by fabric8io.
the class DockerAccessWithHcClient method removeImage.
@Override
public boolean removeImage(String image, boolean... forceOpt) throws DockerAccessException {
boolean force = forceOpt != null && forceOpt.length > 0 && forceOpt[0];
try {
String url = urlBuilder.deleteImage(image, force);
HttpBodyAndStatus response = delegate.delete(url, new BodyAndStatusResponseHandler(), HTTP_OK, HTTP_NOT_FOUND);
if (log.isDebugEnabled()) {
logRemoveResponse(new JSONArray(response.getBody()));
}
return response.getStatusCode() == HTTP_OK;
} catch (IOException e) {
throw new DockerAccessException(e, "Unable to remove image [%s]", image);
}
}
Aggregations