code: public void pruneEmptyDirs(File targetFile) {
          while (isParentAnEmptyDirectory(targetFile)) {
              try {
                  targetFile.getParentFile().delete();
                  targetFile = targetFile.getParentFile();
              } catch (Exception e) {
                  //
              }
          }
      }
docs: prune empty dir
  
  @param targetFile the folder to remove