code: CompletableFuture<Void> deletePath(final String path, final boolean deleteEmptyContainer) {
          final CompletableFuture<Void> result = new CompletableFuture<>();
          final CompletableFuture<Void> deleteNode = new CompletableFuture<>();
  
          try {
              client.delete().inBackground(
                      callback(event -> deleteNode.complete(null),
                              e -> {
                                  if (e instanceof StoreException.DataNotFoundException) { // deleted already
                                      deleteNode.complete(null);
                                  } else {
                                      deleteNode.completeExceptionally(e);
                                  }
                              }, path), executor).forPath(path);
          } catch (Exception e) {
              deleteNode.completeExceptionally(StoreException.create(StoreException.Type.UNKNOWN, e, path));
          }
  
          deleteNode.whenComplete((res, ex) -> {
              if (ex != null) {
                  result.completeExceptionally(ex);
              } else if (deleteEmptyContainer) {
                  final String container = ZKPaths.getPathAndNode(path).getPath();
                  try {
                      client.delete().inBackground(
                              callback(event -> result.complete(null),
                                      e -> {
                                          if (e instanceof StoreException.DataNotFoundException) { // deleted already
                                              result.complete(null);
                                          } else if (e instanceof StoreException.DataNotEmptyException) { // non empty dir
                                              result.complete(null);
                                          } else {
                                              result.completeExceptionally(e);
                                          }
                                      }, path), executor).forPath(container);
                  } catch (Exception e) {
                      result.completeExceptionally(StoreException.create(StoreException.Type.UNKNOWN, e, path));
                  }
              } else {
                  result.complete(null);
              }
          });
          return result;
      }
docs: region curator client store access