@Override
  protected void doApply(ZipFile patchFile, File backupDir, File toFile) throws IOException {
    LOG.info("Delete action. File: " + toFile.getAbsolutePath());

    // a directory can be deleted only when it does not contain any user's content
    boolean canDelete = true;
    if (Files.isDirectory(toFile.toPath(), LinkOption.NOFOLLOW_LINKS)) {
      try (Stream<Path> children = Files.list(toFile.toPath())) {
        canDelete = children.findAny().isEmpty();
      }
    }

    if (canDelete) {
      LOG.info("Delete: " + toFile.getAbsolutePath());
      Utils.delete(toFile);
    }
    else {
      LOG.info("Preserved: " + toFile.getAbsolutePath());
    }
  }
@Override
  protected void doApply(ZipFile patchFile, File backupDir, File toFile)