Hi Anonymous Monk,
Your post seems to have caused some confusion, (war could be a typo of tar) perhaps if you explained what a WAR file is then it would have made more sense to people. File::Find will not know how to unpack the WAR file, so you will need to work out how to do this before searching the resulting files. Using google I found this post which details unpacking jar files. Perhaps you could adapt/learn from it. Failing that use Super Search and see if you can find anything here that will help you.
Hope this helps
Martin | [reply] |
If a WAR file is a JAR file, then it actually is a ZIP file and you can open those with Archive::Zip — which is built on top of Compress::Zlib.
So yes, it can be done, but you'll have to write your own callback for File::Find to check the file extension, open the ZIP file, and list the files in them, or extract the files you want.
| [reply] |
| [reply] |
I think a WAR is some kind of container file used in the Java world and I believe that it is, in effect, a ZIP archive. You may be able to look at individual files inside the WAR using the Archive::Zip module.Cheers, JohnGG | [reply] |
tar, jar, war, ear, sar files
Many file have extensions ending in "a r".
It's because the "ar" stands for archive, and it's such a reasonable way of naming file that the original tar which stands for tape archive was picked up by Sun and the Java community and transmuted into other file formats.
tar - tape archive
jar - java archive
war - web application archive
ear - enterprise archive
sar - service archive
war and ear are jar files, created with the jar utility. In fact, they're a subtype of jar files with the data they contain being in a specific file and directory stucture. In other words, the arrangment of files within a war is such that the file and its contents are suitable for deployment as a webapp under a container such as Apache Tomcat, and the arrangement of files within a ear is such that it's an Enterprise Archive such as you would use under JBoss, etc.
Can you tell us what is the exact thing which you want to be done?
| [reply] |
Hi sago and greatmonks
i want list Class files inside the ear (ear/war/*.class).
using File::Find
| [reply] |
<Joke>War, hunh, what is it good for? <\Joke>
(That was a flashback to the '60s; sorry...)
| [reply] |
Could you please explain what you mean by "war"? | [reply] |