download files with groovy and wget

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

used this to download a bunch of wsdls. Put all addresses in a file and execute the script like

groovy download.groovy file.txt

Copy this code and paste it in your HTML
  1. println "archivo [${args[0]}]"
  2. File f = new File(args[0])
  3. f.each{
  4. String name =it.substring( it.lastIndexOf("/")+1)+".wsdl"
  5. println" saving [$name] "
  6. String cmd ="wget ${it}?wsdl -O ${name}"
  7. println cmd
  8. cmd.execute().text
  9. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.