📄 e383. writing a jar file manifest to a file.txt
字号:
The format of a manifest file is described in:
http://java.sun.com/products/jdk/1.2/docs/guide/jar/manifest.html
This example retrieves the manifest from a JAR file and writes the manifest contents to a file.
try {
// Open the JAR file
JarFile jarfile = new JarFile("filename.jar");
// Get the manifest
Manifest manifest = jarfile.getManifest();
// Write the manifest to a file
OutputStream fos = new FileOutputStream("manifest");
jarfile.getManifest().write(fos);
fos.close();
} catch (IOException e) {
}
Here's an example of a manifest file:
Manifest-Version: 1.0
Specification-Title: Java Platform API Specification
Specification-Version: 1.4
Implementation-Title: Java Runtime Environment
Implementation-Version: 1.4.0-rc
Created-By: 1.4.0-rc (Sun Microsystems Inc.)
Implementation-Vendor: Sun Microsystems, Inc.
Specification-Vendor: Sun Microsystems, Inc.
Name: javax/swing/JScrollPane.class
Java-Bean: True
Name: javax/swing/JCheckBoxMenuItem.class
Java-Bean: True
Name: javax/swing/JTabbedPane.class
Java-Bean: True
Name: javax/swing/JMenuItem.class
Java-Bean: True
Name: javax/swing/JTable.class
Java-Bean: True
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -