code: protected boolean deleteDirectory(Path path, boolean cleanParent) throws IOException {
          boolean pathExists = deleteIfExistsRecursively(path);
          if(pathExists && cleanParent) {
              cleanEmptyParentDirectory(path.getParent());
              return true;
          }
          return false;
      }
docs: Deletes a directory and optionally removes the parent directory if it becomes empty.
  
  @param path
  @param cleanParent
  @return
  @throws IOException