Ignore:
Timestamp:
2014-02-25T00:21:39+01:00 (10 years ago)
Author:
Don-vip
Message:

enable loading of .osm.zip files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/FileImporter.java

    r6830 r6882  
    1010import java.util.List;
    1111import java.util.zip.GZIPInputStream;
     12import java.util.zip.ZipEntry;
     13import java.util.zip.ZipInputStream;
    1214
    1315import javax.swing.JOptionPane;
     
    156158    }
    157159
     160    public static ZipInputStream getZipInputStream(InputStream in) throws IOException {
     161        if (in == null) {
     162            return null;
     163        }
     164        ZipInputStream zis = new ZipInputStream(in);
     165        // Positions the stream at the beginning of first entry
     166        ZipEntry ze = zis.getNextEntry();
     167        if (ze != null && Main.isDebugEnabled()) {
     168            Main.debug("Zip entry: "+ze.getName());
     169        }
     170        return zis;
     171    }
     172
    158173    /**
    159174     * Returns the enabled state of this {@code FileImporter}. When enabled, it is listed and usable in "File->Open" dialog.
Note: See TracChangeset for help on using the changeset viewer.