@Test public void testExtractContainedLibraries() throws Exception { String s = "testExtractContainedLibraries"; byte[] nestedJarContent = s.getBytes(ConfigConstants.DEFAULT_CHARSET); File fakeJar = temporaryFolder.newFile("test.jar"); try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(fakeJar))) { ZipEntry entry = new ZipEntry("lib/internalTest.jar"); zos.putNextEntry(entry); zos.write(nestedJarContent); zos.closeEntry(); } final List<File> files = PackagedProgram.extractContainedLibraries(fakeJar.toURI().toURL()); Assert.assertEquals(1, files.size()); Assert.assertArrayEquals(nestedJarContent, Files.readAllBytes(files.iterator().next().toPath())); }
this.extractedTempLibraries = extractContainedLibraries(jarFileUrl); this.classpaths = classpaths; this.userCodeClassLoader = JobWithJars.buildUserCodeClassLoader(getAllLibraries(), classpaths, getClass().getClassLoader());
this.extractedTempLibraries = extractContainedLibraries(jarFileUrl); this.classpaths = classpaths; this.userCodeClassLoader = JobWithJars.buildUserCodeClassLoader(getAllLibraries(), classpaths, getClass().getClassLoader());
this.extractedTempLibraries = extractContainedLibraries(jarFileUrl); this.classpaths = classpaths; this.userCodeClassLoader = JobWithJars.buildUserCodeClassLoader(getAllLibraries(), classpaths, getClass().getClassLoader());
this.extractedTempLibraries = extractContainedLibraries(jarFileUrl); this.classpaths = classpaths; this.userCodeClassLoader = JobWithJars.buildUserCodeClassLoader(getAllLibraries(), classpaths, getClass().getClassLoader());
libs = PackagedProgram.extractContainedLibraries(new File(jarFile).toURI().toURL()); if (!libs.isEmpty()) { List<Path> libPaths = new ArrayList<>(libs.size());