如下:
InputStream in = new URL("http://www.updown/thumbnail.jpg).openStream();
Path temp = Paths.get("temp.png");
Files.copy(in,temp,StandardCopyOption.REPLACE_EXISTING);
File file = temp.toFile();
System.out.println(file.getAbsolutePath());
如下:
InputStream in = new URL("http://www.updown/thumbnail.jpg).openStream();
Path temp = Paths.get("temp.png");
Files.copy(in,temp,StandardCopyOption.REPLACE_EXISTING);
File file = temp.toFile();
System.out.println(file.getAbsolutePath());
转载于:https://www.cnblogs.com/liangblog/p/10422115.html