private void restoreFromBackup(@Nullable Path backup, IOException e) throws IOException {
    if (backup == null) {
      throw new IOException(UtilBundle.message("safe.write.junk", myTarget), e);
    }

    boolean restored = true;
    try (InputStream in = Files.newInputStream(backup, BACKUP_READ); OutputStream out = Files.newOutputStream(myTarget, MAIN_WRITE)) {
      FileUtil.copy(in, out);
    }
    catch (IOException ex) {
      restored = false;
      e.addSuppressed(ex);
    }
    if (restored) {
      throw new IOException(UtilBundle.message("safe.write.restored", myTarget), e);
    }
    else {
      throw new IOException(UtilBundle.message("safe.write.junk.backup", myTarget, backup.getFileName()), e);
    }
  }
private void restoreFromBackup(@Nullable Path backup, IOException e)