Skip to content

Instantly share code, notes, and snippets.

@ysb33r
Created June 19, 2013 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysb33r/5815662 to your computer and use it in GitHub Desktop.
Save ysb33r/5815662 to your computer and use it in GitHub Desktop.
groovy-vfs makes downloading & unpacking very simple. The following works well for smaller archives. Once the archive contains thousands of files, it is better to download first and then unpack. (This is due to a performance issue inside VFS2, not groovy-vfs).
@Grapes([
@GrabResolver( name='grysb33r', root='http://dl.bintray.com/ysb33r/grysb33r' ),
@Grab( 'org.ysb33r.groovy:groovy-vfs:0.2' ),
@Grab( 'commons-httpclient:commons-httpclient:3.1')
])
import org.ysb33r.groovy.dsl.vfs.VFS
// This will download the compressed archive from Sourceforge and unpack it to a local directory
new VFS() {
cp "tgz:http://downloads.sourceforge.net/project/nant/nant/0.92/nant-0.92-bin.tar.gz",
new File("./Downloads"),
overwrite:true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment