@Override public void close() { super.close(); }
@Override public void close() { super.close(); }
@Override public void close() { super.close(); }
/** * 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 a = new Analyzer(); out.println(a.getBndVersion()); a.close(); return;
/** * 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 * * @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(); } }
/** * @see aQute.bnd.service.diff.Differ#diff(aQute.lib.resource.Jar, * aQute.lib.resource.Jar) */ public Tree tree(Jar newer) throws Exception { Analyzer anewer = new Analyzer(); try { anewer.setJar(newer); return tree(anewer); } finally { anewer.setJar((Jar) null); anewer.close(); } }
/** * @see aQute.bnd.service.diff.Differ#diff(aQute.lib.resource.Jar, * aQute.lib.resource.Jar) */ public Tree tree(Jar newer) throws Exception { Analyzer anewer = new Analyzer(); try { anewer.setJar(newer); return tree(anewer); } finally { anewer.setJar((Jar) null); anewer.close(); } }
/** * @see aQute.bnd.service.diff.Differ#diff(aQute.lib.resource.Jar, * aQute.lib.resource.Jar) */ public Tree tree(Jar newer) throws Exception { Analyzer anewer = new Analyzer(); try { anewer.setJar(newer); return tree(anewer); } finally { anewer.setJar((Jar) null); anewer.close(); } }
analyzer.close(); osgiJar.close();
public Manifest getManifest( MavenProject project, DependencyNode dependencyGraph, Map<String, String> instructions, Properties properties, Jar[] classpath, BuildContext buildContext) throws IOException, MojoFailureException, MojoExecutionException, Exception { Analyzer analyzer = getAnalyzer(project, dependencyGraph, instructions, properties, classpath); Jar jar = analyzer.getJar(); Manifest manifest = jar.getManifest(); if (exportScr) { exportScr(analyzer, jar, scrLocation, buildContext, getLog() ); } // cleanup... analyzer.close(); return manifest; }
private void handleVanillaJarWrap(ArtifactBundlerRequest request, ArtifactBundlerInstructions instructions) throws Exception { Analyzer analyzer = AquteHelper.buildAnalyzer(request, instructions, pedantic); try { populateJar(analyzer, request.getBinaryOutputFile()); bundleUtils.reportErrors(analyzer); removeSignature(request.getBinaryOutputFile()); } finally { analyzer.close(); } }
/** * Visit each class on the class path. * * @param visitor * the visitor */ public void visit(ClassVisitor visitor) throws Exception { Analyzer analyzer = new Analyzer(); try { for (File f : entries) { Jar jar = new Jar(f); try { for (String path : jar.getResources().keySet()) { if (path.endsWith(".class")) { Resource r = jar.getResource(path); Clazz c = new Clazz(analyzer, path, r); c.parseClassFile(); visitor.visit(c); } } } finally { jar.close(); } } } finally { analyzer.close(); } }
/** * Visit each class on the class path. * * @param visitor * the visitor */ public void visit(ClassVisitor visitor) throws Exception { Analyzer analyzer = new Analyzer(); try { for (File f : entries) { Jar jar = new Jar(f); try { for (String path : jar.getResources().keySet()) { if (path.endsWith(".class")) { Resource r = jar.getResource(path); Clazz c = new Clazz(analyzer, path, r); c.parseClassFile(); visitor.visit(c); } } } finally { jar.close(); } } } finally { analyzer.close(); } }
@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(); } } } }
analyzer.close();
wrapper.close();
getInfo(w); w.setJar((Jar) null); w.close();