Changeset 31924 in osm for applications/editors/josm
- Timestamp:
- 2016-01-03T16:07:32+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/SevenZipReader.java
r30908 r31924 6 6 import java.io.File; 7 7 import java.io.FileNotFoundException; 8 import java.io.FileOutputStream;9 8 import java.io.IOException; 10 9 import java.io.InputStream; 11 10 import java.io.OutputStream; 11 import java.nio.file.Files; 12 import java.nio.file.StandardCopyOption; 12 13 import java.util.List; 13 14 import java.util.Map; … … 28 29 import org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler; 29 30 import org.openstreetmap.josm.plugins.opendata.core.util.OdUtils; 30 import org.openstreetmap.josm.tools.Utils;31 31 32 32 public class SevenZipReader extends ArchiveReader { … … 38 38 // Write entire 7z file as a temp file on disk as we need random access later, and "in" can be a network stream 39 39 File tmpFile = File.createTempFile("7z_", ".7z", OdUtils.createTempDir()); 40 try (OutputStream out = new FileOutputStream(tmpFile)) { 41 Utils.copyStream(in, out); 42 } 40 Files.copy(in, tmpFile.toPath(), StandardCopyOption.REPLACE_EXISTING); 43 41 // random must be kept open for later extracting 44 42 @SuppressWarnings("resource")
Note:
See TracChangeset
for help on using the changeset viewer.