Search Java Code Snippets


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





#Java - Code Snippets for '#.Jar' - 3 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");

tmpFile.deleteOnExit();

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);

target.close();

return tmpFile;

}


   Like      Feedback      java.util.jar.JarOutputStream


 Sample 2. Code Sample / Example / Snippet of java.util.jar.Manifest

    public InputStream getDeploymentPackage(String id, String version) throws OverloadedException, IOException {

List<ArtifactData> data = m_provider.getBundleData(id, version);

Manifest manifest = new Manifest();

Attributes main = manifest.getMainAttributes();



main.putValue("Manifest-Version", "1.0");

main.putValue("DeploymentPackage-SymbolicName", id);

main.putValue("DeploymentPackage-Version", version);



for (ArtifactData bd : data) {

manifest.getEntries().put(bd.getFilename(), bd.getManifestAttributes(false));

}



return DeploymentPackageStream.createStreamForThread(m_connectionFactory, manifest, data.iterator(), false);

}


   Like      Feedback      java.util.jar.Manifest


 Sample 3. Code Sample / Example / Snippet of java.util.jar.Attributes

    public InputStream getDeploymentPackage(String id, String version) throws OverloadedException, IOException {

List<ArtifactData> data = m_provider.getBundleData(id, version);

Manifest manifest = new Manifest();

Attributes main = manifest.getMainAttributes();



main.putValue("Manifest-Version", "1.0");

main.putValue("DeploymentPackage-SymbolicName", id);

main.putValue("DeploymentPackage-Version", version);



for (ArtifactData bd : data) {

manifest.getEntries().put(bd.getFilename(), bd.getManifestAttributes(false));

}



return DeploymentPackageStream.createStreamForThread(m_connectionFactory, manifest, data.iterator(), false);

}


   Like      Feedback      java.util.jar.Attributes



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