I work with the ATG Dynamo platform - a Java based platform that uses manifest files to define many configuration details of its modules.
I would like to build some tools and scripts - say, ANT scripts or Maven plugins - to programmatically manipulate these files. Specifically, I want to be able to read existing files and perform some tasks based on the contents on one hand, and to generate new manifest files as part of my build process on the other.
The MANIFEST.MF format seems to be very simple, though there are some rules about line length and white space, so I am sure I can hand-code a lot of this. However, it would be really useful if there already exists an API to to read and write such files according to the spec.
Any suggestions?
Use JarFile#getManifest(). It gives you an instance of Manifest, providing several convenience methods to access the attributes.
JarFile jarFile = new JarFile(file);
Manifest manifest = jarFile.getManifest();
// ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With