File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Read a passowrd protected zip file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Read a passowrd protected zip file" Watch "Read a passowrd protected zip file" New topic
Author

Read a passowrd protected zip file

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Is there any built-in API in new Java for reading a password protected zip file?

TIA,
- Manish
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
The Java classes that read Zip files, e.g. ZipInputStream, do not support decrypting password-protected Zip files. I don't know of any publicly-available code in Java which will do this, either. But this functionality is straightforward to add yourself. The decryption algorithm needed is described in ftp://ftp.pkware.com/appnote.zip. You can subclass the existing Java classes to add support for decryption; you will also have to define a mechanism for a user of your subclass to enter the appropriate password, using a dialog box for example. (And if you do so, please make that code publically available and submit a link to that code as feedback to this question!)


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

http://www.jguru.com/faq/view.jsp?EID=234256


Groovy
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

I have read that faq on JGuru, but I am wondering if there is any built in support in new Java for this.

- Manish
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Moving to I/O and Streams...


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Read a passowrd protected zip file
 
Similar Threads
Can anyone help?
How create encrypted/password-protected zip file?
How to password protect a zip file?
How to unzip password protected zip file in java?
Password protected zip file