void () { File sourceJar; try { Path downloadedArtifactPath = Path.of(FileUtil.loadFile(sourcesLocationFile)); if (!isValidJar(downloadedArtifactPath)) { GradleLog.LOG.warn("Incorrect file header: " + downloadedArtifactPath + ". Unable to process downloaded file as a JAR file"); FileUtil.delete(sourcesLocationFile); resultWrapper.setRejected(); return; } sourceJar = downloadedArtifactPath.toFile(); FileUtil.delete(sourcesLocationFile); } catch (IOException e) { GradleLog.LOG.warn(e); resultWrapper.setRejected(); return; } attachSources(sourceJar, orderEntries); resultWrapper.setDone(); }