Skip to content
Snippets Groups Projects
Commit eba215d0 authored by Jesper Zedlitz's avatar Jesper Zedlitz
Browse files

Version 1.0.3

parent e69fd032
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<groupId>de.landsh.opendata</groupId> <groupId>de.landsh.opendata</groupId>
<artifactId>dcat-uploader</artifactId> <artifactId>dcat-uploader</artifactId>
<version>1.0.2</version> <version>1.0.3</version>
<build> <build>
<plugins> <plugins>
......
...@@ -401,8 +401,8 @@ public class CkanAPI { ...@@ -401,8 +401,8 @@ public class CkanAPI {
} }
boolean doesDatasetExist(String packageId) throws IOException { boolean doesDatasetExist(String packageId) throws IOException {
HttpGet requestPackageShow = new HttpGet(baseURL + "/api/3/action/package_show?id=" + packageId); final HttpGet requestPackageShow = new HttpGet(baseURL + "/api/3/action/package_show?id=" + packageId);
JSONObject response = restClient.executeHttpRequest(requestPackageShow); final JSONObject response = restClient.executeHttpRequest(requestPackageShow);
return isResponseSuccess(response); return isResponseSuccess(response);
} }
...@@ -419,4 +419,18 @@ public class CkanAPI { ...@@ -419,4 +419,18 @@ public class CkanAPI {
return updatePackage(packageObject); return updatePackage(packageObject);
} }
public boolean deleteResource(String resourceId) throws IOException {
final JSONObject json = new JSONObject();
json.put("id", resourceId);
final HttpPost httpPost = new HttpPost(baseURL + "/api/action/resource_delete");
httpPost.addHeader("Authorization", apiKey.toString());
httpPost.addHeader("Content-Type", "application/json");
httpPost.setEntity(new StringEntity(json.toString(), StandardCharsets.UTF_8));
final JSONObject responseJSON = restClient.executeHttpRequest(httpPost);
return responseJSON.getBoolean("success");
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment