Ejemplo n.º 1
0
  public void insertLatestOrNewModifications(
      Material material, MaterialInstance materialInstance, File folder, Modifications list) {
    List<Modification> newChanges =
        list.isEmpty()
            ? materialChecker.findLatestModification(folder, material, subprocessExecutionContext)
            : materialService.modificationsSince(
                material, folder, list.latestRevision(material), subprocessExecutionContext);
    if (newChanges.isEmpty()) {
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(
            String.format(
                "[Material Update] Did not find any new modifications for material '%s' with flyweight '%s' using working directory '%s'",
                material, material.getFingerprint(), folder.getAbsolutePath()));
      }
    } else {
      LOGGER.info(
          String.format(
              "[Material Update] Found '%s' modifications for material '%s' with flyweight '%s' using working directory '%s'",
              newChanges.size(), material, material.getFingerprint(), folder.getAbsolutePath()));

      materialRepository.saveModifications(materialInstance, newChanges);
    }
  }