static File parent(File file) {
        File parent = file.getParentFile();
        return parent == null ? file : parent;
    }
Return the parent directory of a file. This works around Java's quirky API,
which does not honor the UNIX convention of the parent of root being root itself.
shell/src/main/java/org/apache/kafka/shell/MetadataShell.java