tags:

views:

325

answers:

2

Hi, is there a way to grep(find) the text in a particular file, which is in *.jar and this *.jar is in *.war?

A: 

jar files are zip files, so you need a tool that can grep inside a zip file.

It appears there are several at http://www.freedownloadscenter.com/Best/grep-zip.html

Thorbjørn Ravn Andersen
A: 

Are you doing this programmatically from Java?

.war files are basically .zip files, just like .jar files. You can open .zip files with java.util.ZipFile.

Open your .war as a ZipFile, find your .jar within it, open your .jar as a ZipFile, find your text file within it. Now you can read the text and process it however you want.

Does this answer your question?

Cosmic Flame
No but I can. thanks for the tip.
feiroox