Changeset 13204 in josm for trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java
- Timestamp:
- 2017-12-17T00:17:20+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java
r12620 r13204 6 6 import java.awt.Component; 7 7 import java.io.File; 8 import java.io.FileOutputStream;9 8 import java.io.IOException; 10 9 import java.io.InputStream; … … 14 13 import java.nio.charset.StandardCharsets; 15 14 import java.nio.file.Files; 15 import java.nio.file.InvalidPathException; 16 16 import java.nio.file.StandardCopyOption; 17 17 import java.util.Enumeration; … … 115 115 try ( 116 116 InputStream in = downloadConnection.getResponse().getContent(); 117 OutputStream out = new FileOutputStream(file)117 OutputStream out = Files.newOutputStream(file.toPath()) 118 118 ) { 119 119 byte[] buffer = new byte[32_768]; … … 145 145 Logging.warn(msg); 146 146 throw new DownloadException(msg, e); 147 } catch (IOException e) {147 } catch (IOException | InvalidPathException e) { 148 148 if (canceled) 149 149 return;
Note:
See TracChangeset
for help on using the changeset viewer.