nidhin nidhin - 5 months ago 62
Java Question

How to create file object from URL object

I need to create a File object from URL object
My requirement is
I need to create a file object of a web image (say googles logo)

URL url = new URL("");
File f = create image from url object


Using FileUtils in Apache Common IO to simplify the problem:


FileUtils.copyURLToFile(url, f);

The method downloads the URL, url, and save to file f.