java.util.jar.JarFile Java Examples
The following examples show how to use
java.util.jar.JarFile.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DependencyManager.java From ARCHIVE-wildfly-swarm with Apache License 2.0 | 7 votes |
protected void scanBootstrapDependency(File file) { try (JarFile jar = new JarFile(file)) { ZipEntry entry = jar.getEntry("wildfly-swarm-bootstrap.conf"); if (entry != null) { try (InputStream in = jar.getInputStream(entry)) { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String line = null; while ((line = reader.readLine()) != null) { line = line.trim(); if (!line.isEmpty()) { this.bootstrapModules.add(line); } } } } } catch (IOException e) { } }
Example #2
Source File: JarUtils.java From confucius-commons with Apache License 2.0 | 6 votes |
/** * Extract the source {@link JarFile} to target directory with specified {@link JarEntryFilter} * * @param jarResourceURL * The resource URL of {@link JarFile} or {@link JarEntry} * @param targetDirectory * target directory * @param jarEntryFilter * {@link JarEntryFilter} * @throws IOException * When the source jar file is an invalid {@link JarFile} */ public static void extract(URL jarResourceURL, File targetDirectory, JarEntryFilter jarEntryFilter) throws IOException { final JarFile jarFile = JarUtils.toJarFile(jarResourceURL); final String relativePath = JarUtils.resolveRelativePath(jarResourceURL); final JarEntry jarEntry = jarFile.getJarEntry(relativePath); final boolean isDirectory = jarEntry.isDirectory(); List<JarEntry> jarEntriesList = filter(jarFile, new JarEntryFilter() { @Override public boolean accept(JarEntry filteredObject) { String name = filteredObject.getName(); if (isDirectory && name.equals(relativePath)) { return true; } else if (name.startsWith(relativePath)) { return true; } return false; } }); jarEntriesList = doFilter(jarEntriesList, jarEntryFilter); doExtract(jarFile, jarEntriesList, targetDirectory); }
Example #3
Source File: DefaultFileHashCacheTest.java From buck with Apache License 2.0 | 6 votes |
@Test(expected = UnsupportedOperationException.class) public void whenJarMemberWithEmptyManifestIsQueriedThenThrow() throws IOException { Assume.assumeFalse(fileHashCacheMode == FileHashCacheMode.PARALLEL_COMPARISON); Assume.assumeFalse(fileHashCacheMode == FileHashCacheMode.LIMITED_PREFIX_TREE_PARALLEL); ProjectFilesystem filesystem = new FakeProjectFilesystem(); DefaultFileHashCache cache = DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode); Path abiJarPath = Paths.get("empty-manifest.jar"); Path memberPath = Paths.get("Empty.class"); try (CustomZipOutputStream jar = ZipOutputStreams.newOutputStream(filesystem.newFileOutputStream(abiJarPath))) { jar.writeEntry(JarFile.MANIFEST_NAME, new ByteArrayInputStream(new byte[0])); jar.writeEntry( memberPath.toString(), new ByteArrayInputStream("Contents".getBytes(StandardCharsets.UTF_8))); } cache.getForArchiveMember(abiJarPath, memberPath); }
Example #4
Source File: ClasspathDefinitionRegistry.java From arcusplatform with Apache License 2.0 | 6 votes |
private static List<String> loadFromJar(String path) throws IOException { if(path.startsWith("file:")) { path = path.substring(5); } List<String> files = new ArrayList<>(); String [] parts = StringUtils.split(path, '!'); try(JarFile jf = new JarFile(parts[0])) { Enumeration<JarEntry> entries = jf.entries(); while(entries.hasMoreElements()) { String name = entries.nextElement().getName(); if(isDefinitionFolder(name) && name.endsWith("xml")) { files.add(name); } } } return files; }
Example #5
Source File: TimestampCheck.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
static void checkTimestamp(String file, String policyId, String digestAlg) throws Exception { try (JarFile jf = new JarFile(file)) { JarEntry je = jf.getJarEntry("META-INF/OLD.RSA"); try (InputStream is = jf.getInputStream(je)) { byte[] content = IOUtils.readFully(is, -1, true); PKCS7 p7 = new PKCS7(content); SignerInfo[] si = p7.getSignerInfos(); if (si == null || si.length == 0) { throw new Exception("Not signed"); } PKCS9Attribute p9 = si[0].getUnauthenticatedAttributes() .getAttribute(PKCS9Attribute.SIGNATURE_TIMESTAMP_TOKEN_OID); PKCS7 tsToken = new PKCS7((byte[]) p9.getValue()); TimestampToken tt = new TimestampToken(tsToken.getContentInfo().getData()); if (!tt.getHashAlgorithm().toString().equals(digestAlg)) { throw new Exception("Digest alg different"); } if (!tt.getPolicyID().equals(policyId)) { throw new Exception("policyId different"); } } } }
Example #6
Source File: MakeJNLP.java From netbeans with Apache License 2.0 | 6 votes |
/** * Constructs jar or nativelib tag for jars using custom name * @param f * @param dashcnb * @return * @throws IOException */ private String constructJarHref(File f, String dashcnb, String name) throws IOException { String tag = "jar"; if (nativeLibraries != null && nativeLibraries.contains(name)) { tag = "nativelib"; } if (processJarVersions) { if (!f.exists()) { throw new BuildException("JAR file " + f + " does not exist, cannot extract required versioning info."); } JarFile extJar = new JarFile(f); String version = getJarVersion(extJar); if (version != null) { return " <" + tag + " href='" + dashcnb + '/' + name + "' version='" + version + "' size='" + f.length() + "'/>\n"; } } return " <" + tag + " href='" + dashcnb + '/' + name + "'/>\n"; }
Example #7
Source File: SARLRuntime.java From sarl with Apache License 2.0 | 6 votes |
/** Replies if the given JAR file contains a SRE bootstrap. * * <p>The SRE bootstrap detection is based on the service definition within META-INF folder. * * @param jarFile the JAR file to test. * @return <code>true</code> if the given directory contains a SRE. Otherwise <code>false</code>. * @since 0.7 * @see #containsUnpackedBootstrap(File) */ public static boolean containsPackedBootstrap(File jarFile) { try (JarFile jFile = new JarFile(jarFile)) { final ZipEntry jEntry = jFile.getEntry(SREManifestPreferenceConstants.SERVICE_SRE_BOOTSTRAP); if (jEntry != null) { try (InputStream is = jFile.getInputStream(jEntry)) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(is))) { String line = reader.readLine(); if (line != null) { line = line.trim(); if (!line.isEmpty()) { return true; } } } } } } catch (IOException exception) { // } return false; }
Example #8
Source File: TestNormal.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public static void compareJars(JarFile jf1, JarFile jf2) throws Exception { try { if (jf1.size() != jf2.size()) { throw new Exception("Jars " + jf1.getName() + " and " + jf2.getName() + " have different number of entries"); } for (JarEntry elem1 : Collections.list(jf1.entries())) { JarEntry elem2 = jf2.getJarEntry(elem1.getName()); if (elem2 == null) { throw new Exception("Element " + elem1.getName() + " is missing from " + jf2.getName()); } if (!elem1.isDirectory() && elem1.getCrc() != elem2.getCrc()) { throw new Exception("The crc of " + elem1.getName() + " is different."); } } } finally { jf1.close(); jf2.close(); } }
Example #9
Source File: FileUtils.java From netbeans with Apache License 2.0 | 6 votes |
public static File extractJarEntry( final String entry, final File source, final File target) throws IOException { JarFile jar = new JarFile(source); FileOutputStream out = new FileOutputStream(target); try { StreamUtils.transferData(jar.getInputStream(jar.getEntry(entry)), out); return target; } finally { jar.close(); out.close(); } }
Example #10
Source File: CompareTest.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
boolean isNativeClass(JarFile jar, JarEntry entry) throws IOException, ConstantPoolException { String name = entry.getName(); if (name.startsWith("META-INF") || !name.endsWith(".class")) return false; //String className = name.substring(0, name.length() - 6).replace("/", "."); //System.err.println("check " + className); InputStream in = jar.getInputStream(entry); ClassFile cf = ClassFile.read(in); for (int i = 0; i < cf.methods.length; i++) { Method m = cf.methods[i]; if (m.access_flags.is(AccessFlags.ACC_NATIVE)) { // System.err.println(className); return true; } } return false; }
Example #11
Source File: PluginListenersBootStrap.java From DataLink with Apache License 2.0 | 6 votes |
private static List<Class<?>> getClassesFromJar(URL url, String basePack) throws IOException, ClassNotFoundException { List<Class<?>> classes = new ArrayList<>(); JarURLConnection connection = (JarURLConnection) url.openConnection(); if (connection != null) { JarFile jarFile = connection.getJarFile(); if (jarFile != null) { //得到该jar文件下面的类实体 Enumeration<JarEntry> jarEntryEnumeration = jarFile.entries(); while (jarEntryEnumeration.hasMoreElements()) { JarEntry entry = jarEntryEnumeration.nextElement(); String jarEntryName = entry.getName(); //这里我们需要过滤不是class文件和不在basePack包名下的类 if (jarEntryName.contains(".class") && jarEntryName.replaceAll("/", ".").startsWith(basePack)) { String className = jarEntryName.substring(0, jarEntryName.lastIndexOf(".")).replace("/", "."); Class cls = Class.forName(className); classes.add(cls); } } } } return classes; }
Example #12
Source File: ClientVersion.java From OSRS-Deobfuscator with BSD 2-Clause "Simplified" License | 6 votes |
public int getVersion() throws IOException { try (JarFile jar = new JarFile(this.jar)) { for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) { JarEntry entry = it.nextElement(); if (!entry.getName().equals("client.class")) continue; InputStream in = jar.getInputStream(entry); ClassReader reader = new ClassReader(in); VersionClassVisitor v = new VersionClassVisitor(); reader.accept(v, 0); return v.getVersion(); } } return -1; }
Example #13
Source File: ShrinkWrapFatJarPackageServiceTest.java From vertx-maven-plugin with Apache License 2.0 | 6 votes |
@Test public void testEmpty() throws PackagingException, IOException { AbstractVertxMojo mojo = mock(AbstractVertxMojo.class); when(mojo.getLog()).thenReturn(new SystemStreamLog()); Archive archive = new Archive(); archive.setIncludeClasses(false); File output = new File(out, "test-empty.jar"); PackageConfig config = new PackageConfig() .setMojo(mojo) .setOutput(output) .setArchive(archive); service.doPackage(config); assertThat(output).isFile(); JarFile jar = new JarFile(output); List<String> list = jar.stream().map(ZipEntry::getName) .filter(s -> ! s.endsWith("/")) // Directories .collect(Collectors.toList()); assertThat(list).containsExactly("META-INF/MANIFEST.MF"); }
Example #14
Source File: ClassPath.java From codebuff with BSD 2-Clause "Simplified" License | 6 votes |
private void scanDirectory(File directory, ClassLoader classloader, String packagePrefix) throws IOException { File[] files = directory.listFiles(); if (files == null) { logger.warning("Cannot read directory " + directory); // IO error, just skip the directory return; } for (File f : files) { String name = f.getName(); if (f.isDirectory()) { scanDirectory(f, classloader, packagePrefix + name + "/"); } else { String resourceName = packagePrefix + name; if (!resourceName.equals(JarFile.MANIFEST_NAME)) { resources.get(classloader).add(resourceName); } } } }
Example #15
Source File: JspUtil.java From tomcatsrc with Apache License 2.0 | 6 votes |
public static InputStream getInputStream(String fname, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err) throws JasperException, IOException { InputStream in = null; if (jarFile != null) { String jarEntryName = fname.substring(1, fname.length()); ZipEntry jarEntry = jarFile.getEntry(jarEntryName); if (jarEntry == null) { throw new FileNotFoundException(Localizer.getMessage( "jsp.error.file.not.found", fname)); } in = jarFile.getInputStream(jarEntry); } else { in = ctxt.getResourceAsStream(fname); } if (in == null) { throw new FileNotFoundException(Localizer.getMessage( "jsp.error.file.not.found", fname)); } return in; }
Example #16
Source File: Utils.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
static void copyJarFile(JarInputStream in, JarOutputStream out) throws IOException { if (in.getManifest() != null) { ZipEntry me = new ZipEntry(JarFile.MANIFEST_NAME); out.putNextEntry(me); in.getManifest().write(out); out.closeEntry(); } byte[] buffer = new byte[1 << 14]; for (JarEntry je; (je = in.getNextJarEntry()) != null; ) { out.putNextEntry(je); for (int nr; 0 < (nr = in.read(buffer)); ) { out.write(buffer, 0, nr); } } in.close(); markJarFile(out); // add PACK200 comment }
Example #17
Source File: Utils.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
static void copyJarFile(JarInputStream in, JarOutputStream out) throws IOException { if (in.getManifest() != null) { ZipEntry me = new ZipEntry(JarFile.MANIFEST_NAME); out.putNextEntry(me); in.getManifest().write(out); out.closeEntry(); } byte[] buffer = new byte[1 << 14]; for (JarEntry je; (je = in.getNextJarEntry()) != null; ) { out.putNextEntry(je); for (int nr; 0 < (nr = in.read(buffer)); ) { out.write(buffer, 0, nr); } } in.close(); markJarFile(out); // add PACK200 comment }
Example #18
Source File: BasicTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String args[]) throws IOException { JarFile bootclasses = new JarFile("BootSupport.jar"); JarFile agentclasses = new JarFile("AgentSupport.jar"); Instrumentation ins = Agent.getInstrumentation(); // Test 1: Add BootSupport.jar to boot class path and check that // BootSupport is loaded by the bootstrap class loader ins.appendToBootstrapClassLoaderSearch(bootclasses); checkLoadedByLoader("BootSupport", null); // Test 2: Add AgentSupport.jar to the system class path and check that // AgentSupport is loaded by the system class loader. try { ins.appendToSystemClassLoaderSearch(agentclasses); checkLoadedByLoader("AgentSupport", ClassLoader.getSystemClassLoader()); } catch (UnsupportedOperationException x) { System.out.println("System class loader does not support adding to class path"); } // throw exception if a test failed if (failures > 0) { throw new RuntimeException(failures + " test(s) failed."); } }
Example #19
Source File: PackTestZip64.java From hottub with GNU General Public License v2.0 | 6 votes |
static void generateLargeJar(File result, File source) throws IOException { if (result.exists()) { result.delete(); } try (JarOutputStream copyTo = new JarOutputStream(new FileOutputStream(result)); JarFile srcJar = new JarFile(source)) { for (JarEntry je : Collections.list(srcJar.entries())) { copyTo.putNextEntry(je); if (!je.isDirectory()) { copyStream(srcJar.getInputStream(je), copyTo); } copyTo.closeEntry(); } int many = Short.MAX_VALUE * 2 + 2; for (int i = 0 ; i < many ; i++) { JarEntry e = new JarEntry("F-" + i + ".txt"); copyTo.putNextEntry(e); } copyTo.flush(); copyTo.close(); } }
Example #20
Source File: DalClassScanner.java From dal with Apache License 2.0 | 6 votes |
private void findClasses(List<Class<?>> classList, String packageName, URL url, boolean recursive) throws Throwable { JarURLConnection jarURLConnection = (JarURLConnection) url.openConnection(); JarFile jarFile = jarURLConnection.getJarFile(); Enumeration<JarEntry> jarEntries = jarFile.entries(); // jarCount.incrementAndGet(); // LOGGER.info("Scanning jar: " + jarFile.getName()); while (jarEntries.hasMoreElements()) { try { JarEntry jarEntry = jarEntries.nextElement(); String jarEntryName = jarEntry.getName(); String jarEntryClassName = getClassName(jarEntryName); if (jarEntryClassName != null) { String jarEntryPackageName = getPackageName(jarEntryClassName); if (jarEntryPackageName.equals(packageName) || (recursive && jarEntryPackageName.startsWith(packageName))) { tryAddClass(classList, jarEntryClassName); } } } catch (Throwable t) { LOGGER.warn(t.getMessage(), t); } } }
Example #21
Source File: PatchSplitter.java From OptiFabric with Mozilla Public License 2.0 | 5 votes |
public static ClassCache generateClassCache(File inputFile, File classCacheOutput, byte[] inputHash) throws IOException { boolean extractClasses = Boolean.parseBoolean(System.getProperty("optifabric.extract", "false")); File classesDir = new File(classCacheOutput.getParent(), "classes"); if(extractClasses){ classesDir.mkdir(); } ClassCache classCache = new ClassCache(inputHash); try (JarFile jarFile = new JarFile(inputFile)) { Enumeration<JarEntry> entrys = jarFile.entries(); while (entrys.hasMoreElements()) { JarEntry entry = entrys.nextElement(); if ((entry.getName().startsWith("net/minecraft/") || entry.getName().startsWith("com/mojang/")) && entry.getName().endsWith(".class")) { try(InputStream inputStream = jarFile.getInputStream(entry)){ String name = entry.getName(); byte[] bytes = IOUtils.toByteArray(inputStream); classCache.addClass(name, bytes); if(extractClasses){ File classFile = new File(classesDir, entry.getName()); FileUtils.writeByteArrayToFile(classFile, bytes); } } } } } //Remove all the classes that are going to be patched in, we dont want theses on the classpath ZipUtil.removeEntries(inputFile, classCache.getClasses().stream().toArray(String[]::new)); System.out.println("Found " + classCache.getClasses().size() + " patched classes"); classCache.save(classCacheOutput); return classCache; }
Example #22
Source File: JarManifestParser.java From flink with Apache License 2.0 | 5 votes |
/** * Returns the value of the first manifest attribute found in the provided JAR file. * * @param jarFile JAR file to parse * @param attributes Attributes to check * @return Optional holding value of first found attribute * @throws IOException If there is an error accessing the JAR */ private static Optional<String> findFirstManifestAttribute(File jarFile, String... attributes) throws IOException { if (attributes.length == 0) { return Optional.empty(); } try (JarFile f = new JarFile(jarFile)) { return findFirstManifestAttribute(f, attributes); } }
Example #23
Source File: SignaturesUtils.java From DevUtils with Apache License 2.0 | 5 votes |
/** * 从 APK 中读取签名 * @param file 文件 * @return {@link Certificate}[] */ public static Certificate[] getCertificateFromApk(final File file) { try { JarFile jarFile = new JarFile(file); JarEntry je = jarFile.getJarEntry("AndroidManifest.xml"); byte[] readBuffer = new byte[8192]; return loadCertificates(jarFile, je, readBuffer); } catch (Exception e) { LogPrintUtils.eTag(TAG, e, "getCertificateFromApk"); } return null; }
Example #24
Source File: JarFileIO.java From kelinci with Apache License 2.0 | 5 votes |
/** * Extracts all class file names from a JAR file (possibly nested with more JARs). * * @param file The name of the file. * @param classes Class names will be stored in here. */ public static void extractJar(String file, HashSet<String> classes) { try { // open JAR file JarFile jarFile = new JarFile(file); Enumeration<JarEntry> entries = jarFile.entries(); // iterate JAR entries while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String entryName = entry.getName(); if (entryName.endsWith(".class")) { classes.add(entryName); } else if (entryName.endsWith(".jar")) { // load nested JAR extractJar(entryName, classes); } } // close JAR file jarFile.close(); } catch (IOException e) { throw new RuntimeException("Error reading from JAR file: " + file); } }
Example #25
Source File: ShrinkWrapFatJarPackageServiceTest.java From vertx-maven-plugin with Apache License 2.0 | 5 votes |
@Test public void testEmbeddingDependenciesWithAMissingArtifactFile() throws IOException, PackagingException { AbstractVertxMojo mojo = mock(AbstractVertxMojo.class); when(mojo.getLog()).thenReturn(new SystemStreamLog()); Archive archive = new Archive(); archive.setIncludeClasses(false); archive.setDependencySets(ImmutableList.of(new DependencySet())); DefaultArtifact artifact = getSecondArtifact(); artifact.setFile(new File("missing-on-purpose")); Set<Artifact> artifacts = ImmutableSet.of(getFirstArtifact(), artifact); File output = new File(out, "test-all-dependencies-missing-artifact-file.jar"); PackageConfig config = new PackageConfig() .setMojo(mojo) .setOutput(output) .setArtifacts(artifacts) .setArchive(archive); service.doPackage(config); assertThat(output).isFile(); JarFile jar = new JarFile(output); List<String> list = jar.stream().map(ZipEntry::getName) .filter(s -> ! s.endsWith("/")) // Directories .collect(Collectors.toList()); assertThat(list).containsOnly("META-INF/MANIFEST.MF", "testconfig.yaml"); }
Example #26
Source File: ApkSignatureHelper.java From Xpatch with Apache License 2.0 | 5 votes |
private static Certificate[] loadCertificates(JarFile jarFile, JarEntry je, byte[] readBuffer) { try { InputStream is = jarFile.getInputStream(je); while (is.read(readBuffer, 0, readBuffer.length) != -1) { } is.close(); return (Certificate[]) (je != null ? je.getCertificates() : null); } catch (Exception e) { } return null; }
Example #27
Source File: ShadeTask.java From transport with BSD 2-Clause "Simplified" License | 5 votes |
/** * Returns all classes in the input jar */ private static Set<String> classesInJar(File jar) { Set<String> classes = new HashSet<>(); try (JarFile jf = new JarFile(jar)) { jf.stream().forEach(file -> { String name = file.getName(); if (name.endsWith(".class")) { classes.add(name.substring(0, name.lastIndexOf('.'))); } }); } catch (IOException e) { throw new RuntimeException("Error reading from Jar file: " + jar, e); } return classes; }
Example #28
Source File: BatchEnvironment.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private void addJarClassPath(String jarFileName, boolean warn) { try { String jarParent = new File(jarFileName).getParent(); JarFile jar = new JarFile(jarFileName); try { Manifest man = jar.getManifest(); if (man == null) return; Attributes attr = man.getMainAttributes(); if (attr == null) return; String path = attr.getValue(Attributes.Name.CLASS_PATH); if (path == null) return; for (StringTokenizer st = new StringTokenizer(path); st.hasMoreTokens();) { String elt = st.nextToken(); if (jarParent != null) elt = new File(jarParent, elt).getCanonicalPath(); addFile(elt, warn); } } finally { jar.close(); } } catch (IOException e) { // log.error(Position.NOPOS, // "error.reading.file", jarFileName, // e.getLocalizedMessage()); } }
Example #29
Source File: FindNativeFiles.java From hottub with GNU General Public License v2.0 | 5 votes |
public void run(String[] args) throws IOException, ConstantPoolException { JarFile jar = new JarFile(args[0]); Set<JarEntry> entries = getNativeClasses(jar); for (JarEntry e: entries) { String name = e.getName(); String className = name.substring(0, name.length() - 6).replace("/", "."); System.out.println(className); } }
Example #30
Source File: TestVectorRunner.java From aws-encryption-sdk-java with Apache License 2.0 | 5 votes |
@Parameterized.Parameters(name="Compatibility Test: {0}") @SuppressWarnings("unchecked") public static Collection<Object[]> data() throws Exception { final String zipPath = System.getProperty("testVectorZip"); if (zipPath == null) { return Collections.emptyList(); } final JarURLConnection jarConnection = (JarURLConnection) new URL("jar:" + zipPath + "!/").openConnection(); try (JarFile jar = jarConnection.getJarFile()) { final Map<String, Object> manifest = readJsonMapFromJar(jar, "manifest.json"); final Map<String, Object> metaData = (Map<String, Object>) manifest.get("manifest"); // We only support "awses-decrypt" type manifests right now if (!"awses-decrypt".equals(metaData.get("type"))) { throw new IllegalArgumentException("Unsupported manifest type: " + metaData.get("type")); } if (!Integer.valueOf(1).equals(metaData.get("version"))) { throw new IllegalArgumentException("Unsupported manifest version: " + metaData.get("version")); } final Map<String, KeyEntry> keys = parseKeyManifest(readJsonMapFromJar(jar, (String) manifest.get("keys"))); final KmsMasterKeyProvider kmsProv = KmsMasterKeyProvider .builder() .withCredentials(new DefaultAWSCredentialsProviderChain()) .build(); List<Object[]> testCases = new ArrayList<>(); for (Map.Entry<String, Map<String, Object>> testEntry : ((Map<String, Map<String, Object>>) manifest.get("tests")).entrySet()) { testCases.add(new Object[]{testEntry.getKey(), parseTest(testEntry.getKey(), testEntry.getValue(), keys, jar, kmsProv)}); } return testCases; } }