读取jar包的manifest信息 并写入到文件
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
public class WriteJARFileManifestToFile {
public static void main(String[] args) throws Exception {
// create a new JAR file to read from the specified file
JarFile jarfile = new JarFile("jsp-api.jar");
// get the manifest for that file
Manifest manifest = jarfile.getManifest();
// write the manifest to a file
OutputStream fos = new FileOutputStream("Manifest.MF");
manifest.write(fos);
fos.close();
}
}
出处:http://outofmemory.cn/code-snippet/363/jiang-jar-bao-manifest-information-xieru-come-file
上一篇: 001.CDN概述
下一篇: windows 结束端口占用