From c7281ca590d285489d0f93b07e6e69144e944f39 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Thu, 20 Dec 2018 11:38:16 -0500 Subject: [PATCH] Added 'deleteNode()' method. --- .../CoordinationService.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/coordinationservice/CoordinationService.java b/Core/src/org/sleuthkit/autopsy/coordinationservice/CoordinationService.java index 6272cc9ab7..36cf5a503c 100644 --- a/Core/src/org/sleuthkit/autopsy/coordinationservice/CoordinationService.java +++ b/Core/src/org/sleuthkit/autopsy/coordinationservice/CoordinationService.java @@ -357,6 +357,24 @@ public final class CoordinationService { } } + /** + * Deletes a specified node. + * + * @param category The desired category in the namespace. + * @param nodePath The node to be deleted. + * + * @throws CoordinationServiceException If there is an error deleting the + * node. + */ + void deleteNode(CategoryNode category, String nodePath) throws CoordinationServiceException { + String fullNodePath = getFullyQualifiedNodePath(category, nodePath); + try { + curator.delete().forPath(fullNodePath); + } catch (Exception ex) { + throw new CoordinationServiceException(String.format("Failed to delete node %s", fullNodePath), ex); + } + } + /** * Gets a list of the child nodes of a category in the namespace. *