Created
January 24, 2014 11:40
-
-
Save mgdelacroix/8595866 to your computer and use it in GitHub Desktop.
Using URL to copy files in groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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