LoaderStatus (@Nullable Object loadResults) { if (!(loadResults instanceof File)) return LoaderStatus.FAILED; LOG.info("Start extraction of JPS caches"); File zipFile = (File)loadResults; long fileSize = zipFile.length(); File tmpFolder = new File(myBuildCacheFolder.getParentFile(), "tmp"); try { // Start extracting after download myContext.sendDescriptionStatusMessage(JpsBuildBundle.message("progress.text.extracting.downloaded.results")); myContext.checkCanceled(); long start = System.currentTimeMillis(); AtomicInteger extractItemsCount = new AtomicInteger(); new Decompressor.Zip(zipFile).postProcessor(path -> { extractItemsCount.incrementAndGet(); myContext.checkCanceled(); if (extractItemsCount.get() == 130) { int expectedDownloads = myContext.getTotalExpectedDownloads(); myContext.getNettyClient().sendDescriptionStatusMessage(JpsBuildBundle.message("progress.details.extracting.project.caches"), expectedDownloads); extractItemsCount.set(0); } }).extract(tmpFolder.toPath()); JpsCacheLoadingSystemStats.setDecompressionTimeMs(fileSize, System.currentTimeMillis() - start); long deletionStart = System.currentTimeMillis(); FileUtil.delete(zipFile); JpsCacheLoadingSystemStats.setDeletionTimeMs(fileSize, System.currentTimeMillis() - deletionStart); LOG.info("Unzip compilation caches took: " + (System.currentTimeMillis() - start)); myTmpCacheFolder = tmpFolder; return LoaderStatus.COMPLETE; } catch (ProcessCanceledException | IOException e) { if (e instanceof IOException) LOG.warn("Failed unzip downloaded compilation caches", e); FileUtil.delete(zipFile); FileUtil.delete(tmpFolder); } return LoaderStatus.FAILED; }