@Override
  public boolean isEmptyDirDeletable(Path dir) {
    if (userScanSnapshotEnabled) {
      /*
       * If user scan snapshot feature is enabled(see HBASE-21995), then when namespace or table
       * exists, the archive namespace or table directories should not be deleted because the HDFS
       * acls are set at these directories; the archive data directory should not be deleted because
       * the HDFS acls of global permission is set at this directory.
       */
      return isEmptyArchiveDirDeletable(dir);
    }
    return true;
  }
Implementation of a file cleaner that checks if a empty directory with no subdirs and subfiles is
deletable when user scan snapshot feature is enabled
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SnapshotScannerHDFSAclCleaner.java