wood burning stoves 2.0*
The moose likes Java in General and the fly likes reading file from jar - Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "reading file from jar - Problem" Watch "reading file from jar - Problem" New topic
Author

reading file from jar - Problem

Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 225

Hi Folks !!!
i am trying to read the content of class files from jar .
though i can able to get the entry names from jar , i cant able to read the content .

below is the code whichi am using .


Please sugesst how to go ahead .
Thanks


Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Read from the JarInputStream directly. Everytime you call getNextJarEntry it positions itself to the next entry, and you can read its contents until all is read (read returns -1). Then you call getNextJarEntry again and read all again.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: reading file from jar - Problem
 
Similar Threads
Directory / File not found
extracting all the contents of a jar file
extract directory from current jar
Pblm with JAR/InputStream
JarInputStream