Skip to content

Instantly share code, notes, and snippets.

@orangeclover
Created November 5, 2011 11:41
Show Gist options
  • Select an option

  • Save orangeclover/1341420 to your computer and use it in GitHub Desktop.

Select an option

Save orangeclover/1341420 to your computer and use it in GitHub Desktop.
Web上にあるjarを、GROOV_HOME/lib にダウンロードする
// Web上にあるjarを、GROOV_HOME/lib にダウンロードする
// 例 gomoku
// https://gist.github.com/1341266
downLoadUrl = "https://github.com/downloads/sile/gomoku/gomoku-0.0.4.jar"
GroovyHome = System.getProperty("groovy.home") + File.separator + "lib"
url = new URL(downLoadUrl)
file = new File(GroovyHome, new File(url.file).name)
url.withInputStream { input ->
file.bytes = input.bytes
}
println "download $url -> $file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment