title: Groovy download image from URL
body: <p>I am wondering what the proper way to go about downloading the image from this RUL would be: <a href="http://www.hidemyass.com/proxy-list/img/port/7018246/1" rel="noreferrer">http://www.hidemyass.com/proxy-list/img/port/7018246/1</a></p>
  
  <p>The way I tried downloading it, leaves the file in an unknown format. Current code snippet I tested out is:</p>
  
  <pre><code>public void download(def address) {
  
      def file = new FileOutputStream(address.tokenize("/")[-1])
      def out = new BufferedOutputStream(file)
      out &lt;&lt; new URL(address).openStream()
      out.close()
  }
  </code></pre>