< prev index next >
src/java.base/share/classes/java/nio/file/Files.java
Print this page
*** 3065,3075 ****
*
* <p> <b>Usage example</b>: Suppose we want to capture a web page and save
* it to a file:
* <pre>
* Path path = ...
! * URI u = URI.create("http://java.sun.com/");
* try (InputStream in = u.toURL().openStream()) {
* Files.copy(in, path);
* }
* </pre>
*
--- 3065,3075 ----
*
* <p> <b>Usage example</b>: Suppose we want to capture a web page and save
* it to a file:
* <pre>
* Path path = ...
! * URI u = URI.create("http://www.example.com/");
* try (InputStream in = u.toURL().openStream()) {
* Files.copy(in, path);
* }
* </pre>
*
< prev index next >