HttpResponse response = doRequest(HttpMethod.PUT, "modules/" + moduleName,
ImmutableMap.of("X-Class-Name", className),
Locations.newInputSupplier(jarLocation));
if (HttpResponseStatus.CONFLICT.getCode() == response.getResponseCode()) {
throw new ModuleConflictException(String.format("Failed to add module %s due to conflict, details: %s",
moduleName, getDetails(response)));
}
if (HttpResponseStatus.OK.getCode() != response.getResponseCode()) {
throw new DatasetManagementException(String.format("Failed to add module %s, details: %s",
moduleName, getDetails(response)));