Search Jars For Class


/ Published in: Groovy
Save to your folder(s)



Copy this code and paste it in your HTML
  1.  
  2.  
  3. def cDir = new File(".");
  4. def jarContents;
  5. cDir.eachFileRecurse{file ->
  6. if (file.name =~ /.*.jar$/)
  7. {
  8. jarContents = "jar tvf ${file}".execute().text;
  9. jarContents.eachLine{line ->
  10. if (line.contains(args[0])){
  11. print "*** found in ${file.canonicalPath}:";
  12. println line;
  13. }
  14. }
  15. }
  16. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.