DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Download A Web Page
// Groovy code to download a web-page
def download(address, outfile)
{
def file = new FileOutputStream(outfile)
def out = new BufferedOutputStream(file)
out << new URL(address).openStream()
out.close()
}
download("http://www.google.com", "google.html");






Comments
Snippets Manager replied on Mon, 2008/04/21 - 12:49am