Ignore:
Timestamp:
2016-01-03T16:07:32+01:00 (9 years ago)
Author:
donvip
Message:

[josm_opendata] improve file copy

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  
    66import java.io.File;
    77import java.io.FileNotFoundException;
    8 import java.io.FileOutputStream;
    98import java.io.IOException;
    109import java.io.InputStream;
    1110import java.io.OutputStream;
     11import java.nio.file.Files;
     12import java.nio.file.StandardCopyOption;
    1213import java.util.List;
    1314import java.util.Map;
     
    2829import org.openstreetmap.josm.plugins.opendata.core.datasets.AbstractDataSetHandler;
    2930import org.openstreetmap.josm.plugins.opendata.core.util.OdUtils;
    30 import org.openstreetmap.josm.tools.Utils;
    3131
    3232public class SevenZipReader extends ArchiveReader {
     
    3838        // Write entire 7z file as a temp file on disk as we need random access later, and "in" can be a network stream
    3939        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);
    4341        // random must be kept open for later extracting
    4442        @SuppressWarnings("resource")
Note: See TracChangeset for help on using the changeset viewer.