Untitled
Anonymous
plain_text
08/24/2023 11:53 AM
480 B
18
Indexable
static void saveImageFromUrl(String imageUrl, String fileName) throws IOException {
URL url = new URL(imageUrl);
Path savePath = Path.of("./saveScreen", fileName);
if (!Files.exists(savePath)) {
Files.createDirectories(savePath.getParent());
Files.copy(url.openStream(), savePath);
}
}Editor is loading...