This content has been marked as final. Show 10 replies
good for you... what is your question?
hi thx for u r reply,
i have two temporary files(.txt) . is there any java program to zip that two files.
What do you mean by zip? Want to add them to a .zip archive, or want to add them to a .jar archive? You searching for a zip program written in Java?
Please explain a bit further..
add them to a .zip archive, i am searching for a zip program written in Java?
And got there by using following hard code:
If you are trying to write it yourself, check out http://java.sun.com/developer/technicalArticles/Programming/compression/
Found it using google: http://www.google.be/search?hl=nl&q=java.util.zip+tutorial&meta=
i dont want Zip tool .just i want to know a simple java progaram that zips the two temporary files that may be any two files.ie it may be .txt files
Do you want to write a part of it yourself or do you want us to prepare you a complete solution? I provided you with a link to Java's zipping tutorial. If you took the effort to read it, you'll know there is an example zip.java.
You can put the initialisation in your main, take what's in the for loop, put it into a function. I assume you can write a program that takes 2 command line parameters, and pass those params to your zip function and you've got it... That's how far I'll go for your solution!
Thank U boss,
are u from
i got it
Try to use java.util.zip.ZipFile class to work on this.