Share

Search Java Code Snippets


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





Java - Code Samples

 Sample 1. Code Sample / Example / Snippet of org.apache.commons.compress.archivers.ArchiveOutputStream

    protected File createEmptyArchive(final String archivename) throws Exception {

ArchiveOutputStream out = null;

OutputStream stream = null;

archiveList = new ArrayList<String>();

try {

archive = File.createTempFile("empty", "." + archivename);

archive.deleteOnExit();

stream = new FileOutputStream(archive);

out = factory.createArchiveOutputStream(archivename, stream);

out.finish();

} finally {

if (out != null) {

out.close();

} else if (stream != null) {

stream.close();

}

}

return archive;

}


   Like      Feedback      org.apache.commons.compress.archivers.ArchiveOutputStream



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



comments powered by Disqus