本文整理了Java中aQute.bnd.osgi.Analyzer.setJar()
方法的一些代码示例,展示了Analyzer.setJar()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analyzer.setJar()
方法的具体详情如下:
包路径:aQute.bnd.osgi.Analyzer
类名称:Analyzer
方法名:setJar
[英]Set the JAR directly we are going to work on.
[中]直接设置我们要处理的罐子。
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
/**
* 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;
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
/**
* 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;
}
代码示例来源:origin: biz.aQute/bndlib
/**
* @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();
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
/**
* @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();
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
/**
* @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();
}
}
代码示例来源:origin: biz.aQute/bndlib
/**
* 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);
}
代码示例来源:origin: reficio/p2-maven-plugin
private static Analyzer instantiateAnalyzer(ArtifactBundlerRequest request) throws Exception {
Analyzer analyzer = new Analyzer();
analyzer.setJar(getInputJarWithBlankManifest(request));
return analyzer;
}
代码示例来源:origin: biz.aQute.bnd/bndlib
/**
* 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);
}
代码示例来源:origin: biz.aQute.bnd/bnd
/**
* 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);
}
代码示例来源:origin: biz.aQute/bndlib
/**
* 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();
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
/**
* 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;
}
}
代码示例来源:origin: biz.aQute.bnd/bnd
/**
* 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();
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
/**
* 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;
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
/**
* 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();
}
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
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);
}
代码示例来源:origin: biz.aQute/bndlib
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);
}
代码示例来源:origin: biz.aQute.bnd/bndlib
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);
}
代码示例来源:origin: biz.aQute.bnd/bnd
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);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
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);
}
代码示例来源:origin: biz.aQute.bnd/bnd
@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();
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!