Beispiel #1
0
  private static Path cacheAssimilator(
      ModuleKeyCache<Path> strCache, ModuleKey key, Path prog, Environment environment)
      throws IOException {
    if (strCache == null) return prog;

    log.beginTask("Caching", "Cache assimilator", Log.CACHING);
    try {
      Path cacheProg = environment.createCachePath(prog.getFile().getName());
      if (FileCommands.exists(prog)) FileCommands.copyFile(prog, cacheProg);
      else cacheProg = prog;

      Path oldProg = strCache.putGet(key, cacheProg);
      //      FileCommands.delete(oldProg);

      log.log("Cache Location: " + cacheProg, Log.CACHING);
      return cacheProg;
    } finally {
      log.endTask();
    }
  }