Search Java Code Snippets

  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.

#Java - Code Snippets for '#Java.util.jar.JarOutputStream' - 1 code snippet(s) found

 Sample 1. Code Sample / Example / Snippet of java.util.jar.JarOutputStream

    private File createBundle(String symbolicName, String version) throws IOException {

File tmpFile = File.createTempFile("tmpbundle-", "jar");


Manifest manifest = new Manifest();

manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0");

if (symbolicName != null) {

manifest.getMainAttributes().putValue(Constants.BUNDLE_SYMBOLICNAME, symbolicName);


if (version != null) {

manifest.getMainAttributes().putValue(Constants.BUNDLE_VERSION, version);


JarOutputStream target = new JarOutputStream(new FileOutputStream(tmpFile), manifest);


return tmpFile;


   Like      Feedback      java.util.jar.JarOutputStream

Subscribe to Java News and Posts. Get latest updates and posts on Java from
Enter your email address:
Delivered by FeedBurner