Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Zip Directory using Java  RSS feed

 
Alvaro Quintana
Greenhorn
Posts: 10
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, i would like to know how to Zip a directory using Java, i've found that i could use the java.util.zip package but i need to zip the directory and put a password to the file created.... this is the only way i've found until now so i am open to new ideas... so the main idea is to compress a directory in such a way that only my application knows how to extract the compressed file.... Thanks to all
 
Alvaro Quintana
Greenhorn
Posts: 10
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, after a lot of search, i found a way:



See ya later and hope this helps
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be aware that this encryption just encrypts the file independently of the fact that it a zip file. Even if you change to use one of the AES PBE algorithms it will not be equivalent to the zip encryption defined in http://www.winzip.com/aes_info.htm so you will not be able to decrypt it using one of the later WinZip (Version 11 ?) versions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!