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

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

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

Jar.setDoNotTouchManifest介绍

[英]Make sure nobody touches the manifest! If the bundle is signed, we do not want anybody to touch the manifest after the digests have been calculated.
[中]确保没有人碰舱单!如果捆绑包已签名,我们不希望任何人在计算摘要后触摸清单。

代码示例

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

@Override
  public void run() {
    try {
      try (Jar src = new Jar(sources)) {
        try (Jar bin = new Jar(binary)) {
          bin.setDoNotTouchManifest();
          for (String path : src.getResources()
            .keySet())
            bin.putResource("OSGI-OPT/src/" + path, src.getResource(path));
          bin.write(out);
        }
        out.setLastModified(System.currentTimeMillis());
      }
    } catch (Exception e) {
      throw Exceptions.duck(e);
    }
  }
});

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

@Override
  public void run() {
    try {
      try (Jar src = new Jar(sources)) {
        try (Jar bin = new Jar(binary)) {
          bin.setDoNotTouchManifest();
          for (String path : src.getResources()
            .keySet())
            bin.putResource("OSGI-OPT/src/" + path, src.getResource(path));
          bin.write(out);
        }
        out.setLastModified(System.currentTimeMillis());
      }
    } catch (Exception e) {
      throw Exceptions.duck(e);
    }
  }
});

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

if (f.exists()) {
  Jar jar = new Jar(f);
  jar.setDoNotTouchManifest();
  addClose(jar);
  String path = "WEB-INF/lib/" + f.getName();

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

if (f.exists()) {
  Jar jar = new Jar(f);
  jar.setDoNotTouchManifest();
  addClose(jar);
  String path = "WEB-INF/lib/" + f.getName();

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

if (f.exists()) {
  Jar jar = new Jar(f);
  jar.setDoNotTouchManifest();
  addClose(jar);
  String path = "WEB-INF/lib/" + f.getName();

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

if (f.exists()) {
  Jar jar = new Jar(f);
  jar.setDoNotTouchManifest();
  buildInstrs.compression()
    .ifPresent(jar::setCompression);

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

if (f.exists()) {
  Jar jar = new Jar(f);
  jar.setDoNotTouchManifest();
  buildInstrs.compression()
    .ifPresent(jar::setCompression);

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

@Override
public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception {
  project.prepare();
  Collection<Container> runbundles = project.getRunbundles();
  Jar jar = new Jar(project.getName());
  jar.setDoNotTouchManifest();
  for (Container container : runbundles) {
    File source = container.getFile();
    String path = nonCollidingPath(jar, source.getName());
    jar.putResource(path, new FileResource(source));
  }
  return new SimpleEntry<>(jar.getName(), new JarResource(jar, true));
}

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

private void noSuchFile(Jar jar, String clause, Map<String, String> extra, String source, String destinationPath)
  throws Exception {
  List<Jar> src = getJarsFromName(source, Constants.INCLUDE_RESOURCE + " " + source);
  if (!src.isEmpty()) {
    for (Jar j : src) {
      String quoted = j.getSource() != null ? j.getSource()
        .getName() : j.getName();
      // Do not touch the manifest so this also
      // works for signed files.
      j.setDoNotTouchManifest();
      JarResource jarResource = new JarResource(j);
      String path = destinationPath.replace(source, quoted);
      logger.debug("copy d={} s={} path={}", jar, j, path);
      copy(jar, path, jarResource, extra);
    }
  } else {
    Resource lastChance = make.process(source);
    if (lastChance != null) {
      String x = extra.get("extra");
      if (x != null)
        lastChance.setExtra(x);
      copy(jar, destinationPath, lastChance, extra);
    } else
      error("Input file does not exist: %s", source).header(source)
        .context(clause);
  }
}

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

private void noSuchFile(Jar jar, String clause, Map<String, String> extra, String source, String destinationPath)
  throws Exception {
  List<Jar> src = getJarsFromName(source, Constants.INCLUDE_RESOURCE + " " + source);
  if (!src.isEmpty()) {
    for (Jar j : src) {
      String quoted = j.getSource() != null ? j.getSource()
        .getName() : j.getName();
      // Do not touch the manifest so this also
      // works for signed files.
      j.setDoNotTouchManifest();
      JarResource jarResource = new JarResource(j);
      String path = destinationPath.replace(source, quoted);
      logger.debug("copy d={} s={} path={}", jar, j, path);
      copy(jar, path, jarResource, extra);
    }
  } else {
    Resource lastChance = make.process(source);
    if (lastChance != null) {
      String x = extra.get("extra");
      if (x != null)
        lastChance.setExtra(x);
      copy(jar, destinationPath, lastChance, extra);
    } else
      error("Input file does not exist: %s", source).header(source)
        .context(clause);
  }
}

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

@Override
public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception {
  project.prepare();
  Collection<Container> runbundles = project.getRunbundles();
  Jar jar = new Jar(project.getName());
  jar.setDoNotTouchManifest();
  for (Container container : runbundles) {
    File source = container.getFile();
    String path = nonCollidingPath(jar, source.getName());
    jar.putResource(path, new FileResource(source));
  }
  return new SimpleEntry<>(jar.getName(), new JarResource(jar, true));
}

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

private void noSuchFile(Jar jar, @SuppressWarnings("unused") String clause, Map<String,String> extra, String source, String destinationPath)
    throws Exception {
  Jar src = getJarFromName(source, "Include-Resource " + source);
  if (src != null) {
    // Do not touch the manifest so this also
    // works for signed files.
    src.setDoNotTouchManifest();
    JarResource jarResource = new JarResource(src);
    jar.putResource(destinationPath, jarResource);
  } else {
    Resource lastChance = make.process(source);
    if (lastChance != null) {
      String x = extra.get("extra");
      if (x != null)
        lastChance.setExtra(x);
      jar.putResource(destinationPath, lastChance);
    } else
      error("Input file does not exist: " + source);
  }
}

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

private void noSuchFile(Jar jar, @SuppressWarnings("unused")
String clause, Map<String,String> extra, String source, String destinationPath) throws Exception {
  Jar src = getJarFromName(source, Constants.INCLUDE_RESOURCE + " " + source);
  if (src != null) {
    // Do not touch the manifest so this also
    // works for signed files.
    src.setDoNotTouchManifest();
    JarResource jarResource = new JarResource(src);
    jar.putResource(destinationPath, jarResource);
  } else {
    Resource lastChance = make.process(source);
    if (lastChance != null) {
      String x = extra.get("extra");
      if (x != null)
        lastChance.setExtra(x);
      jar.putResource(destinationPath, lastChance);
    } else
      error("Input file does not exist: " + source);
  }
}

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

private void noSuchFile(Jar jar, @SuppressWarnings("unused")
String clause, Map<String,String> extra, String source, String destinationPath) throws Exception {
  Jar src = getJarFromName(source, Constants.INCLUDE_RESOURCE + " " + source);
  if (src != null) {
    // Do not touch the manifest so this also
    // works for signed files.
    src.setDoNotTouchManifest();
    JarResource jarResource = new JarResource(src);
    jar.putResource(destinationPath, jarResource);
  } else {
    Resource lastChance = make.process(source);
    if (lastChance != null) {
      String x = extra.get("extra");
      if (x != null)
        lastChance.setExtra(x);
      jar.putResource(destinationPath, lastChance);
    } else
      error("Input file does not exist: " + source);
  }
}

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

jar.setDoNotTouchManifest();

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

jar.setDoNotTouchManifest();

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

jar.setDoNotTouchManifest();

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

jar.setDoNotTouchManifest();

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

jar.setDoNotTouchManifest();

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

dot.setManifest(manifest);
else
  dot.setDoNotTouchManifest();

相关文章

微信公众号

最新文章

更多