void () { if (myTmpCacheFolder == null) { LOG.warn("Nothing to apply, download results are empty"); return; } File newTimestampFolder = new File(myTmpCacheFolder, TIMESTAMPS_FOLDER_NAME); if (newTimestampFolder.exists()) FileUtil.delete(newTimestampFolder); myContext.sendDescriptionStatusMessage(JpsBuildBundle.message("progress.text.applying.jps.caches")); if (myBuildCacheFolder != null) { myContext.sendDescriptionStatusMessage(JpsBuildBundle.message("progress.details.applying.downloaded.caches")); // Copy timestamp old folder to new cache dir File timestamps = new File(myBuildCacheFolder, TIMESTAMPS_FOLDER_NAME); if (timestamps.exists()) { try { newTimestampFolder.mkdirs(); FileUtil.copyDir(timestamps, newTimestampFolder); } catch (IOException e) { LOG.warn("Couldn't copy timestamps from old JPS cache", e); } } // Create new empty fsStateFile File fsStateFile = new File(myTmpCacheFolder, FS_STATE_FILE); fsStateFile.delete(); try { fsStateFile.createNewFile(); } catch (IOException e) { LOG.warn("Couldn't create new empty " + FS_STATE_FILE + " file", e); } // Remove old cache dir JpsCachesLoaderUtil.delete(myBuildCacheFolder, isCleanupAsynchronously); myTmpCacheFolder.renameTo(myBuildCacheFolder); //subTaskIndicator.finished(); LOG.debug("JPS cache downloads finished"); } }