aspose file tools*
The moose likes Java in General and the fly likes extracting all the contents of a jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "extracting all the contents of a jar file" Watch "extracting all the contents of a jar file" New topic
Author

extracting all the contents of a jar file

mythily prakash
Ranch Hand

Joined: Jan 27, 2006
Posts: 31
hi,

Any one can tell me how to implement the command
"jar -xvf myjar.jar" programmatically.I've written the program as



but it throws the following exception as:

Entry Name: META-INF/
ex.jar opened.
META-INF/ extracted.
ex.jar closed.

Entry Name: META-INF/MANIFEST.MF
ex.jar opened.
ex.jar closed.
Exception in thread "main" java.io.FileNotFoundException: META-INF\MANIFEST.MF (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:201)
at java.io.FileOutputStream.<init>(FileOutputStream.java:92)
at jara.extract(jara.java:46)
at jara.main(jara.java:14)

Pls tell me how to recover from it.


Best Regards,<br />Mythily.S<br />9886530336
Joni Salonen
Ranch Hand

Joined: Jan 07, 2006
Posts: 53
You need to create the directory first:

mythily prakash
Ranch Hand

Joined: Jan 27, 2006
Posts: 31
Thank u Friend,
Here is my code :

Thank u somuch.!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: extracting all the contents of a jar file
 
Similar Threads
JarInputStream
Accessing jar file contents
unjar a file
ZipInputStream problem
creating jar file programatically