aQute.lib.osgi.Jar.doManifest()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(285)

本文整理了Java中aQute.lib.osgi.Jar.doManifest()方法的一些代码示例,展示了Jar.doManifest()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jar.doManifest()方法的具体详情如下:
包路径:aQute.lib.osgi.Jar
类名称:Jar
方法名:doManifest

Jar.doManifest介绍

暂无

代码示例

代码示例来源:origin: biz.aQute/aQute.bnd

public void write(OutputStream out) throws IOException {
  ZipOutputStream jout = nomanifest ? new ZipOutputStream(out) : new JarOutputStream(out);
  Set<String> done = new HashSet<String>();
  Set<String> directories = new HashSet<String>();
  if (doNotTouchManifest) {
    writeResource(jout, directories, "META-INF/MANIFEST.MF",
        getResource("META-INF/MANIFEST.MF"));
    done.add("META-INF/MANIFEST.MF");
  } else if (!nomanifest)
    doManifest(done, jout);
  for (Map.Entry<String, Resource> entry : getResources().entrySet()) {
    // Skip metainf contents
    if (!done.contains(entry.getKey()))
      writeResource(jout, directories, (String) entry.getKey(),
          (Resource) entry.getValue());
  }
  jout.finish();
}

代码示例来源:origin: biz.aQute/bnd

public void write(OutputStream out) throws Exception {
  ZipOutputStream jout = nomanifest || doNotTouchManifest ? new ZipOutputStream(out)
      : new JarOutputStream(out);
  Set<String> done = new HashSet<String>();
  Set<String> directories = new HashSet<String>();
  if (doNotTouchManifest) {
    Resource r = getResource("META-INF/MANIFEST.MF");
    if (r != null) {
      writeResource(jout, directories, "META-INF/MANIFEST.MF", r);
      done.add("META-INF/MANIFEST.MF");
    }
  } else
    doManifest(done, jout);
  for (Map.Entry<String, Resource> entry : getResources().entrySet()) {
    // Skip metainf contents
    if (!done.contains(entry.getKey()))
      writeResource(jout, directories, (String) entry.getKey(),
          (Resource) entry.getValue());
  }
  jout.finish();
}

相关文章