java - Generating a JAR Manifest -
i need generate manifest jar file (in code) containing following permissions:
permissions: all-permissions
so far i've gotten far:
manifest manifest = new manifest(); attributes global = manifest.getmainattributes(); global.put(new attributes.name("permissions"), "all-permissions"); file jarloader = new file("test.jar"); outputstream os = new fileoutputstream(jarloader); jaroutputstream jos = new jaroutputstream(os, manifest); jos.close();
however erases contents of jar file, creates manifest, , manifest blank. don't understand i'm doing wrong after reading information on , point me in correct direction.
in understanding (i'm no expert) should open jarinputstream jar file have , iterate on jarentry's (like here: jarinputstreamexample). every entry not belong "manifest.mf" pass directly next jaroutputstream (you have 1 of available, right?). jarentry belonging current jar's manifest.mf replace own version , done!
sorry not beeing more specific.
Comments
Post a Comment