RaKasUniverse.info

I still don't know why I registered this domain!

Archive for the ‘java.util.zip’ tag

Java Zip API: How to Create a Zip File Using Java

with 4 comments

This is a follow-up to my earlier post “Java Zip API: How to Read a Zip File Using Java“. This time it’s about how to create a zip file using Java. This is even simpler than reading a zip file.

Following is a very simple example which create a zip file named RaKasUniverse.zip. Inside that zip file we will create a directory named MyDirectory and inside that, we will have a file named MyFile.txt. That text file will contain the text “Java Zip API: How to Create a Zip File Using Java”. In the example we will be using following classes from Java API.
Read the rest of this entry »

Written by Rakhitha

July 11th, 2010 at 10:59 pm

Java Zip API: How to Read a Zip File Using Java

with 3 comments

Java API give a very simple set of classes to deal with zip files in its java.util.zip package. I am just going to show how to access the content of a zip file using these classes. Basically in java point of view a zip file is a collection of zip entries. you just select the zip entry that you like to read and extract its content using an InputStream. However this API do not support handling of password protected zip files.

Read the rest of this entry »

Written by Rakhitha

June 11th, 2010 at 6:52 pm

Posted in Java Stuff

Tagged with , , , ,