/** * Set the JAR file we are going to work in. This will read the JAR in * memory. * * @param file * @throws IOException */ public Jar setJar(File file) throws IOException { Jar jar = new Jar(file); setJar(jar); return jar; }
/** * Set the JAR file we are going to work in. This will read the JAR in * memory. * * @param file * @throws IOException */ public Jar setJar(File file) throws IOException { Jar jar = new Jar(file); setJar(jar); return jar; }
/** * Set the JAR file we are going to work in. This will read the JAR in * memory. * * @param jar * @return * @throws IOException */ public Jar setJar(File jar) throws IOException { Jar jarx = new Jar(jar); addClose(jarx); return setJar(jarx); }
private static Analyzer instantiateAnalyzer(ArtifactBundlerRequest request) throws Exception { Analyzer analyzer = new Analyzer(); analyzer.setJar(getInputJarWithBlankManifest(request)); return analyzer; }
/** * Set the JAR file we are going to work in. This will read the JAR in * memory. * * @param jar * @return * @throws IOException */ public Jar setJar(File jar) throws IOException { Jar jarx = new Jar(jar); addClose(jarx); return setJar(jarx); }
/** * Set the JAR file we are going to work in. This will read the JAR in * memory. * * @param jar * @return * @throws IOException */ public Jar setJar(File jar) throws IOException { Jar jarx = new Jar(jar); addClose(jarx); return setJar(jarx); }
/** * Specifically for Maven * * @param properties * the properties */ public static Properties getManifest(File dirOrJar) throws Exception { Analyzer analyzer = new Analyzer(); try { analyzer.setJar(dirOrJar); Properties properties = new Properties(); properties.put(IMPORT_PACKAGE, "*"); properties.put(EXPORT_PACKAGE, "*"); analyzer.setProperties(properties); Manifest m = analyzer.calcManifest(); Properties result = new Properties(); for (Iterator<Object> i = m.getMainAttributes().keySet().iterator(); i.hasNext();) { Attributes.Name name = (Attributes.Name) i.next(); result.put(name.toString(), m.getMainAttributes().getValue(name)); } return result; } finally { analyzer.close(); } }
/** * Specifically for Maven */ public static Properties getManifest(File dirOrJar) throws Exception { try (Analyzer analyzer = new Analyzer()) { analyzer.setJar(dirOrJar); Properties properties = new UTF8Properties(); properties.put(IMPORT_PACKAGE, "*"); properties.put(EXPORT_PACKAGE, "*"); analyzer.setProperties(properties); Manifest m = analyzer.calcManifest(); Properties result = new UTF8Properties(); for (Iterator<Object> i = m.getMainAttributes() .keySet() .iterator(); i.hasNext();) { Attributes.Name name = (Attributes.Name) i.next(); result.put(name.toString(), m.getMainAttributes() .getValue(name)); } return result; } }
/** * Specifically for Maven * * @param properties * the properties */ public static Properties getManifest(File dirOrJar) throws Exception { Analyzer analyzer = new Analyzer(); try { analyzer.setJar(dirOrJar); Properties properties = new UTF8Properties(); properties.put(IMPORT_PACKAGE, "*"); properties.put(EXPORT_PACKAGE, "*"); analyzer.setProperties(properties); Manifest m = analyzer.calcManifest(); Properties result = new UTF8Properties(); for (Iterator<Object> i = m.getMainAttributes().keySet().iterator(); i.hasNext();) { Attributes.Name name = (Attributes.Name) i.next(); result.put(name.toString(), m.getMainAttributes().getValue(name)); } return result; } finally { analyzer.close(); } }
/** * Specifically for Maven */ public static Properties getManifest(File dirOrJar) throws Exception { try (Analyzer analyzer = new Analyzer()) { analyzer.setJar(dirOrJar); Properties properties = new UTF8Properties(); properties.put(IMPORT_PACKAGE, "*"); properties.put(EXPORT_PACKAGE, "*"); analyzer.setProperties(properties); Manifest m = analyzer.calcManifest(); Properties result = new UTF8Properties(); for (Iterator<Object> i = m.getMainAttributes() .keySet() .iterator(); i.hasNext();) { Attributes.Name name = (Attributes.Name) i.next(); result.put(name.toString(), m.getMainAttributes() .getValue(name)); } return result; } }
/** * Specifically for Maven * * @param properties * the properties */ public static Properties getManifest(File dirOrJar) throws Exception { Analyzer analyzer = new Analyzer(); try { analyzer.setJar(dirOrJar); Properties properties = new UTF8Properties(); properties.put(IMPORT_PACKAGE, "*"); properties.put(EXPORT_PACKAGE, "*"); analyzer.setProperties(properties); Manifest m = analyzer.calcManifest(); Properties result = new UTF8Properties(); for (Iterator<Object> i = m.getMainAttributes().keySet().iterator(); i.hasNext();) { Attributes.Name name = (Attributes.Name) i.next(); result.put(name.toString(), m.getMainAttributes().getValue(name)); } return result; } finally { analyzer.close(); } }
public Verifier(Jar jar) throws Exception { this.analyzer = new Analyzer(this); this.analyzer.use(this); addClose(analyzer); this.analyzer.setJar(jar); this.manifest = this.analyzer.calcManifest(); this.main = Domain.domain(manifest); this.dot = jar; getInfo(analyzer); }
public Verifier(Jar jar) throws Exception { this.analyzer = new Analyzer(this); this.analyzer.use(this); addClose(analyzer); this.analyzer.setJar(jar); this.manifest = this.analyzer.calcManifest(); this.main = Domain.domain(manifest); this.dot = jar; getInfo(analyzer); }
public Verifier(Jar jar) throws Exception { this.analyzer = new Analyzer(this); this.analyzer.use(this); addClose(analyzer); this.analyzer.setJar(jar); this.manifest = this.analyzer.calcManifest(); this.main = Domain.domain(manifest); this.dot = jar; getInfo(analyzer); }
public Verifier(Jar jar) throws Exception { this.analyzer = new Analyzer(this); this.analyzer.use(this); addClose(analyzer); this.analyzer.setJar(jar); this.manifest = this.analyzer.calcManifest(); this.main = Domain.domain(manifest); this.dot = jar; getInfo(analyzer); }
public Verifier(Jar jar) throws Exception { this.analyzer = new Analyzer(this); this.analyzer.use(this); addClose(analyzer); this.analyzer.setJar(jar); this.manifest = this.analyzer.calcManifest(); this.main = Domain.domain(manifest); this.dot = jar; getInfo(analyzer); }
@Description("Show the Execution Environments of a JAR") public void _ees(EEOptions options) throws Exception { for (String path : options._()) { File f = getFile(path); if (!f.isFile()) { error("Not a file"); } else { Jar jar = new Jar(f); Analyzer a = new Analyzer(this); try { a.setJar(jar); a.analyze(); out.printf("%s %s%n", jar.getName(), a.getEEs()); } finally { a.close(); } } } }