private void writeRestoreData(BufferedWriter writer, Path outputDir) throws IOException {
    generator.writeComment(writer, RESTORE_DATA_COMMENT);
    for (Map.Entry<File, File> entry : backedUpFiles.entrySet()) {
      File backup = entry.getKey();
      String[] backupFiles = backup.list();
      boolean backupHasFiles =
          backup.isDirectory() && backupFiles != null && backupFiles.length != 0;
      backup = outputDir.relativize(backup.toPath()).toFile();
      File original = entry.getValue();
      if (original.isDirectory()) {
        generator.writeCopyDirectoryContents(writer, backup, original, backupHasFiles);
      } else {
        generator.writeCopyFile(writer, backup, original);
      }
    }
  }
This class is used to automatically generate a restore script for a backup. It keeps a list of
files that were backed up, and a list of files that we should test for to avoid overriding when
we restore the backup.

<p>
It generates either a restore.sh for unix or a restore.bat for windows.
geode-core/src/main/java/org/apache/geode/internal/cache/backup/RestoreScript.java