/ Published in: Groovy
Eg: groovy findjar "Servlet" /opt/tomcat/lib
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/env groovy import java.util.jar.* //Usage check. println "usage: ${this.class.name} searchstr jarfile [jarfile]" println " jarfile can be a directory, which will include all jar files." } //Collect args for jar files. searchstr = args[0] jarfiles = [] file.eachFileMatch(~/.*\.jar$/){ jarfiles.add(it) } jarfiles.add(file) } } //println binding.variables //Find and print the entry listing! println "$entry.name : $file.canonicalPath" } } }