void add(Jar jar) throws Exception { Analyzer analyzer = new Analyzer(this); analyzer.setJar(jar); analyzer.analyze(); analyzers.add(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 IOException { Analyzer analyzer = new Analyzer(); 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; }
/** * 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(); } }
analyzer.setJar(jar); analyzer.setProperties(properties);
analyzer.setJar(jar); analyzer.setProperties(properties);
Analyzer analyzer = new Analyzer(); analyzer.setPedantic(isPedantic()); analyzer.setJar(jar); analyzer.analyze(); if ((options & USES) != 0) {
Analyzer analyzer = new Analyzer(); analyzer.setPedantic(isPedantic()); analyzer.setJar(jar); analyzer.analyze(); if ((options & USES) != 0) {
try { analyzer.setPedantic(isPedantic()); analyzer.setJar(bundle); Jar dot = analyzer.getJar();
try { analyzer.setPedantic(isPedantic()); analyzer.setJar(bundle); Jar dot = analyzer.getJar();
try { Analyzer analyzer = new Analyzer(); analyzer.setJar(output); analyzer.analyze();