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