URL url = config.resolveURL(String.format("data/modules/%s", moduleName));
HttpResponse response = restClient.execute(HttpMethod.DELETE, url, config.getAccessToken(),
HttpURLConnection.HTTP_CONFLICT,
HttpURLConnection.HTTP_NOT_FOUND);
if (response.getResponseCode() == HttpURLConnection.HTTP_CONFLICT) {
throw new DatasetModuleCannotBeDeletedException(moduleName);
} else if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
throw new DatasetModuleNotFoundException(moduleName);
}
}