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

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

本文整理了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

  1. @Override
  2. public void run() {
  3. try {
  4. try (Jar src = new Jar(sources)) {
  5. try (Jar bin = new Jar(binary)) {
  6. bin.setDoNotTouchManifest();
  7. for (String path : src.getResources()
  8. .keySet())
  9. bin.putResource("OSGI-OPT/src/" + path, src.getResource(path));
  10. bin.write(out);
  11. }
  12. out.setLastModified(System.currentTimeMillis());
  13. }
  14. } catch (Exception e) {
  15. throw Exceptions.duck(e);
  16. }
  17. }
  18. });

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

  1. @Override
  2. public void run() {
  3. try {
  4. try (Jar src = new Jar(sources)) {
  5. try (Jar bin = new Jar(binary)) {
  6. bin.setDoNotTouchManifest();
  7. for (String path : src.getResources()
  8. .keySet())
  9. bin.putResource("OSGI-OPT/src/" + path, src.getResource(path));
  10. bin.write(out);
  11. }
  12. out.setLastModified(System.currentTimeMillis());
  13. }
  14. } catch (Exception e) {
  15. throw Exceptions.duck(e);
  16. }
  17. }
  18. });

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

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

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

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

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

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

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

  1. if (f.exists()) {
  2. Jar jar = new Jar(f);
  3. jar.setDoNotTouchManifest();
  4. buildInstrs.compression()
  5. .ifPresent(jar::setCompression);

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

  1. if (f.exists()) {
  2. Jar jar = new Jar(f);
  3. jar.setDoNotTouchManifest();
  4. buildInstrs.compression()
  5. .ifPresent(jar::setCompression);

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

  1. @Override
  2. public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception {
  3. project.prepare();
  4. Collection<Container> runbundles = project.getRunbundles();
  5. Jar jar = new Jar(project.getName());
  6. jar.setDoNotTouchManifest();
  7. for (Container container : runbundles) {
  8. File source = container.getFile();
  9. String path = nonCollidingPath(jar, source.getName());
  10. jar.putResource(path, new FileResource(source));
  11. }
  12. return new SimpleEntry<>(jar.getName(), new JarResource(jar, true));
  13. }

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

  1. private void noSuchFile(Jar jar, String clause, Map<String, String> extra, String source, String destinationPath)
  2. throws Exception {
  3. List<Jar> src = getJarsFromName(source, Constants.INCLUDE_RESOURCE + " " + source);
  4. if (!src.isEmpty()) {
  5. for (Jar j : src) {
  6. String quoted = j.getSource() != null ? j.getSource()
  7. .getName() : j.getName();
  8. // Do not touch the manifest so this also
  9. // works for signed files.
  10. j.setDoNotTouchManifest();
  11. JarResource jarResource = new JarResource(j);
  12. String path = destinationPath.replace(source, quoted);
  13. logger.debug("copy d={} s={} path={}", jar, j, path);
  14. copy(jar, path, jarResource, extra);
  15. }
  16. } else {
  17. Resource lastChance = make.process(source);
  18. if (lastChance != null) {
  19. String x = extra.get("extra");
  20. if (x != null)
  21. lastChance.setExtra(x);
  22. copy(jar, destinationPath, lastChance, extra);
  23. } else
  24. error("Input file does not exist: %s", source).header(source)
  25. .context(clause);
  26. }
  27. }

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

  1. private void noSuchFile(Jar jar, String clause, Map<String, String> extra, String source, String destinationPath)
  2. throws Exception {
  3. List<Jar> src = getJarsFromName(source, Constants.INCLUDE_RESOURCE + " " + source);
  4. if (!src.isEmpty()) {
  5. for (Jar j : src) {
  6. String quoted = j.getSource() != null ? j.getSource()
  7. .getName() : j.getName();
  8. // Do not touch the manifest so this also
  9. // works for signed files.
  10. j.setDoNotTouchManifest();
  11. JarResource jarResource = new JarResource(j);
  12. String path = destinationPath.replace(source, quoted);
  13. logger.debug("copy d={} s={} path={}", jar, j, path);
  14. copy(jar, path, jarResource, extra);
  15. }
  16. } else {
  17. Resource lastChance = make.process(source);
  18. if (lastChance != null) {
  19. String x = extra.get("extra");
  20. if (x != null)
  21. lastChance.setExtra(x);
  22. copy(jar, destinationPath, lastChance, extra);
  23. } else
  24. error("Input file does not exist: %s", source).header(source)
  25. .context(clause);
  26. }
  27. }

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

  1. @Override
  2. public Entry<String, Resource> export(String type, Project project, Map<String, String> options) throws Exception {
  3. project.prepare();
  4. Collection<Container> runbundles = project.getRunbundles();
  5. Jar jar = new Jar(project.getName());
  6. jar.setDoNotTouchManifest();
  7. for (Container container : runbundles) {
  8. File source = container.getFile();
  9. String path = nonCollidingPath(jar, source.getName());
  10. jar.putResource(path, new FileResource(source));
  11. }
  12. return new SimpleEntry<>(jar.getName(), new JarResource(jar, true));
  13. }

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

  1. private void noSuchFile(Jar jar, @SuppressWarnings("unused") String clause, Map<String,String> extra, String source, String destinationPath)
  2. throws Exception {
  3. Jar src = getJarFromName(source, "Include-Resource " + source);
  4. if (src != null) {
  5. // Do not touch the manifest so this also
  6. // works for signed files.
  7. src.setDoNotTouchManifest();
  8. JarResource jarResource = new JarResource(src);
  9. jar.putResource(destinationPath, jarResource);
  10. } else {
  11. Resource lastChance = make.process(source);
  12. if (lastChance != null) {
  13. String x = extra.get("extra");
  14. if (x != null)
  15. lastChance.setExtra(x);
  16. jar.putResource(destinationPath, lastChance);
  17. } else
  18. error("Input file does not exist: " + source);
  19. }
  20. }

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

  1. private void noSuchFile(Jar jar, @SuppressWarnings("unused")
  2. String clause, Map<String,String> extra, String source, String destinationPath) throws Exception {
  3. Jar src = getJarFromName(source, Constants.INCLUDE_RESOURCE + " " + source);
  4. if (src != null) {
  5. // Do not touch the manifest so this also
  6. // works for signed files.
  7. src.setDoNotTouchManifest();
  8. JarResource jarResource = new JarResource(src);
  9. jar.putResource(destinationPath, jarResource);
  10. } else {
  11. Resource lastChance = make.process(source);
  12. if (lastChance != null) {
  13. String x = extra.get("extra");
  14. if (x != null)
  15. lastChance.setExtra(x);
  16. jar.putResource(destinationPath, lastChance);
  17. } else
  18. error("Input file does not exist: " + source);
  19. }
  20. }

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

  1. private void noSuchFile(Jar jar, @SuppressWarnings("unused")
  2. String clause, Map<String,String> extra, String source, String destinationPath) throws Exception {
  3. Jar src = getJarFromName(source, Constants.INCLUDE_RESOURCE + " " + source);
  4. if (src != null) {
  5. // Do not touch the manifest so this also
  6. // works for signed files.
  7. src.setDoNotTouchManifest();
  8. JarResource jarResource = new JarResource(src);
  9. jar.putResource(destinationPath, jarResource);
  10. } else {
  11. Resource lastChance = make.process(source);
  12. if (lastChance != null) {
  13. String x = extra.get("extra");
  14. if (x != null)
  15. lastChance.setExtra(x);
  16. jar.putResource(destinationPath, lastChance);
  17. } else
  18. error("Input file does not exist: " + source);
  19. }
  20. }

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

  1. jar.setDoNotTouchManifest();

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

  1. jar.setDoNotTouchManifest();

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

  1. jar.setDoNotTouchManifest();

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

  1. jar.setDoNotTouchManifest();

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

  1. jar.setDoNotTouchManifest();

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

  1. dot.setManifest(manifest);
  2. else
  3. dot.setDoNotTouchManifest();

相关文章