CloseableHttpClient client = HttpClients.createDefault();
HttpGet httpGet = new HttpGet("...YOUR URL...");
try {
CloseableHttpResponse response = client.execute(httpGet);
HttpEntity entity = response.getEntity();
byte[] data = EntityUtils.toByteArray(entity);
FileOutputStream fos = new FileOutputStream("C:\\Users\\user\\Desktop\\temp.jpg");
fos.write(data);
fos.close();
} catch (IOException var7) {
var7.printStackTrace();
}
|