java.util.jar.Manifest.clear()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(180)

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

Manifest.clear介绍

[英]Resets the both the main attributes as well as the entry attributes associated with this Manifest.
[中]

代码示例

代码示例来源:origin: hcoles/pitest

  1. private void createJarFromClassPathResources(final FileOutputStream fos,
  2. final String location) throws IOException {
  3. final Manifest m = new Manifest();
  4. m.clear();
  5. final Attributes global = m.getMainAttributes();
  6. if (global.getValue(Attributes.Name.MANIFEST_VERSION) == null) {
  7. global.put(Attributes.Name.MANIFEST_VERSION, "1.0");
  8. }
  9. final File mylocation = new File(location);
  10. global.putValue(BOOT_CLASSPATH, getBootClassPath(mylocation));
  11. global.putValue(PREMAIN_CLASS, AGENT_CLASS_NAME);
  12. global.putValue(CAN_REDEFINE_CLASSES, "true");
  13. global.putValue(CAN_SET_NATIVE_METHOD, "true");
  14. try (JarOutputStream jos = new JarOutputStream(fos, m)) {
  15. addClass(HotSwapAgent.class, jos);
  16. addClass(CodeCoverageStore.class, jos);
  17. addClass(InvokeReceiver.class, jos);
  18. }
  19. }

代码示例来源:origin: org.microemu/microemu-javase

  1. public void clear() {
  2. super.clear();
  3. midletEntries = null;
  4. correctedJarURL = null;
  5. }

代码示例来源:origin: org.knopflerfish/framework

  1. /**
  2. * Delegate to original manifest.
  3. */
  4. @Override
  5. public void clear() {
  6. mf.clear();
  7. mainAttrs = null;
  8. }

代码示例来源:origin: com.android.tools.build/builder

  1. mManifest.clear();
  2. byte[] manifestBytes = manifestEntry.read();
  3. mManifest.read(new ByteArrayInputStream(manifestBytes));

相关文章