private static void removeEmptyParentDirectories(Path containerPath, Path path) throws IOException {
        logger.debug("removing empty parents: {}", path);
        while (true) {
            var parent = path.getParent();
            if (parent == null || path.equals(containerPath)) {
                break;
            }
            var view = Files.getFileAttributeView(path, UserDefinedFileAttributeView.class);
            if (view != null && Set.copyOf(view.list()).contains(XATTR_CONTENT_MD5)) {
                break;
            }
            try {
                logger.debug("deleting: {}", path);
                Files.delete(path);
            } catch (DirectoryNotEmptyException dnee) {
                break;
            }
            path = path.getParent();
        }
    }
AbstractNio2BlobStore implicitly creates directories when creating a key /a/b/c.
When removing /a/b/c, it must clean up /a and /a/b, unless a client explicitly created a subdirectory which has file attributes.
src/main/java/org/gaul/s3proxy/nio2blob/AbstractNio2BlobStore.java