Ignore:
Timestamp:
2013-08-14T13:12:50+02:00 (11 years ago)
Author:
bastiK
Message:

fixed #8686 - Allow ZIP files whose paths are relative to the ZIP root in JOSM's map styling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java

    r6070 r6148  
    66import java.awt.Color;
    77import java.io.ByteArrayInputStream;
     8import java.io.File;
    89import java.io.IOException;
    910import java.io.InputStream;
     
    1112import java.util.List;
    1213import java.util.Map.Entry;
     14import java.util.zip.ZipEntry;
     15import java.util.zip.ZipFile;
    1316
    1417import org.openstreetmap.josm.data.osm.Node;
     
    8891
    8992        MirroredInputStream in = new MirroredInputStream(url);
    90         InputStream zip = in.getZipEntry("mapcss", "style");
    91         if (zip != null) {
    92             zipIcons = in.getFile();
    93             return zip;
     93        if (isZip) {
     94            File file = in.getFile();
     95            Utils.close(in);
     96            ZipFile zipFile = new ZipFile(file);
     97            zipIcons = file;
     98            ZipEntry zipEntry = zipFile.getEntry(zipEntryPath);
     99            return zipFile.getInputStream(zipEntry);
    94100        } else {
    95101            zipIcons = null;
Note: See TracChangeset for help on using the changeset viewer.