Posted By

m3rol666 on 08/30/11


Tagged

download files groovy wget


Versions (?)

download files with groovy and wget


 / Published in: Groovy
 

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

groovy download.groovy file.txt

  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  

You need to login to post a comment.