You can make use of ImageIO in order to load the image from an URL and then write it to a file. Something like this:
URL url = new URL("http://google.com/pathtoaimage.jpg");
BufferedImage img = ImageIO.read(url);
File file = new File("downloaded.jpg");
ImageIO.write(img, "jpg", file);
This also allows you to convert the image to some other format if needed.