@Override
  public @NotNull Path copyPathToTargetIfRequired(@NotNull Path path) {
    if (myClasspathDirectory == null || myHostClasspathDirectory == null) {
      return path;
    }
    Path targetFile = myHostClasspathDirectory.resolve(path.getFileName());
    try {
      FileTime originalFileTimestamp = Files.getLastModifiedTime(path);
      FileTime targetFileTimestamp;
      try {
        targetFileTimestamp = Files.getLastModifiedTime(targetFile);
      }
      catch (FileNotFoundException | NoSuchFileException ignored) {
        targetFileTimestamp = null;
      }
      if (targetFileTimestamp == null || targetFileTimestamp.compareTo(originalFileTimestamp) < 0) {
        FileUtil.copyFileOrDir(path.toFile(), targetFile.toFile());
      }
    }
    catch (IOException ignored) {
      return path;
    }
    return targetFile;
  }
@Override
  public @NotNull Path copyPathToTargetIfRequired(@NotNull Path path)