Untitled
unknown
plain_text
3 years ago
358 B
13
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...