MCPcopy Index your code
hub / github.com/actions/setup-java / downloadTool

Method downloadTool

src/distributions/oracle/installer.ts:27–54  ·  view source on GitHub ↗
(
    javaRelease: JavaDownloadRelease
  )

Source from the content-addressed store, hash-verified

25 }
26
27 protected async downloadTool(
28 javaRelease: JavaDownloadRelease
29 ): Promise<JavaInstallerResults> {
30 core.info(
31 `Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
32 );
33 let javaArchivePath = await tc.downloadTool(javaRelease.url);
34
35 core.info(`Extracting Java archive...`);
36 const extension = getDownloadArchiveExtension();
37 if (process.platform === 'win32') {
38 javaArchivePath = renameWinArchive(javaArchivePath);
39 }
40 const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
41
42 const archiveName = fs.readdirSync(extractedJavaPath)[0];
43 const archivePath = path.join(extractedJavaPath, archiveName);
44 const version = this.getToolcacheVersionName(javaRelease.version);
45
46 const javaPath = await tc.cacheDir(
47 archivePath,
48 this.toolcacheFolderName,
49 version,
50 this.architecture
51 );
52
53 return {version: javaRelease.version, path: javaPath};
54 }
55
56 protected async findPackageForDownload(
57 range: string

Callers

nothing calls this directly

Calls 3

renameWinArchiveFunction · 0.90
extractJdkFileFunction · 0.90

Tested by

no test coverage detected