Skip to content

Instantly share code, notes, and snippets.

@mgdelacroix
Created January 24, 2014 11:40
Show Gist options
  • Save mgdelacroix/8595866 to your computer and use it in GitHub Desktop.
Save mgdelacroix/8595866 to your computer and use it in GitHub Desktop.
Using URL to copy files in groovy
URL penny = new URL('http://tankian99.files.wordpress.com/2011/08/kaley_cuoco_by_m4rios.jpg')
new File('/tmp/penny.jpg') << penny.openStream()
URL localPenny = new URL('file:///tmp/penny.jpg')
new File('/tmp/penny2.jpg') << localPenny.openStream()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment