Return to Snippet

Revision: 25017
at March 18, 2010 03:35 by zxeem


Initial Code

def cDir = new File(".");
def jarContents;
cDir.eachFileRecurse{file ->
  if (file.name =~ /.*.jar$/)
  {
    jarContents = "jar tvf ${file}".execute().text;
    jarContents.eachLine{line ->
      if (line.contains(args[0])){
        print "*** found in ${file.canonicalPath}:";
        println line;
      }
    }
  }
}

Initial URL

                                

Initial Description

                                

Initial Title
Search Jars For Class

Initial Tags
class, groovy

Initial Language
Groovy