public static void downloadImage(String imageUrl, String savePath) throws MalformedURLException, IOException {
Connection conn = Jsoup.connect(imageUrl);
conn = conn.timeout(10000).ignoreContentType(true);
Connection.Response resultImageResponse = conn.execute();
FileOutputStream out = (new FileOutputStream(new java.io.File(savePath)));
out.write(resultImageResponse.bodyAsBytes());
out.close();
}
Không có nhận xét nào:
Đăng nhận xét