public void removeComment(String commentPath) throws RegistryException {
AbderaClient abderaClient = new AbderaClient(abdera);
String resourcePath = commentPath.substring(0, commentPath.indexOf(";comments:"));
int commentId = Integer.parseInt(
commentPath.substring(commentPath.indexOf(";comments:") + ";comments:".length()));
ClientResponse resp = abderaClient.delete(baseURI + APPConstants.ATOM +
encodeURL(resourcePath +
RegistryConstants.URL_SEPARATOR) +
"comment:" + commentId,
getAuthorization());
if (resp.getType() == Response.ResponseType.SUCCESS) {
if (log.isDebugEnabled()) {
log.debug("Removing comment: " + commentId + " for resourcePath + " + resourcePath +
" succeeded." + ", Response Status: " + resp.getStatus() +
", Response Type: " + resp.getType());
}
abderaClient.teardown();
} else {
String msg = "Removing comment: " + commentId + " for resourcePath + " + resourcePath +
" succeeded." + ", Response Status: " + resp.getStatus() +
", Response Type: " + resp.getType();
abderaClient.teardown();
log.error(msg);
throw new RegistryException(msg);
}