Changeset 7248 in josm for trunk/src/org/openstreetmap/josm/gui/tagging
- Timestamp:
- 2014-06-14T12:40:50+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
r7082 r7248 25 25 import org.openstreetmap.josm.Main; 26 26 import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference; 27 import org.openstreetmap.josm.io. MirroredInputStream;27 import org.openstreetmap.josm.io.CachedFile; 28 28 import org.openstreetmap.josm.tools.XmlObjectParser; 29 29 import org.xml.sax.SAXException; … … 225 225 public static Collection<TaggingPreset> readAll(String source, boolean validate) throws SAXException, IOException { 226 226 Collection<TaggingPreset> tp; 227 CachedFile cf = new CachedFile(source).setHttpAccept(PRESET_MIME_TYPES); 227 228 try ( 228 MirroredInputStream s = new MirroredInputStream(source, null, PRESET_MIME_TYPES);229 229 // zip may be null, but Java 7 allows it: https://blogs.oracle.com/darcy/entry/project_coin_null_try_with 230 InputStream zip = s.findZipEntryInputStream("xml", "preset")230 InputStream zip = cf.findZipEntryInputStream("xml", "preset") 231 231 ) { 232 232 if (zip != null) { 233 zipIcons = s.getFile();234 } 235 try (InputStreamReader r = new InputStreamReader(zip == null ? s: zip, StandardCharsets.UTF_8)) {233 zipIcons = cf.getFile(); 234 } 235 try (InputStreamReader r = new InputStreamReader(zip == null ? cf.getInputStream() : zip, StandardCharsets.UTF_8)) { 236 236 tp = readAll(new BufferedReader(r), validate); 237 237 }
Note:
See TracChangeset
for help on using the changeset viewer.