Changeset 7082 in josm for trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
- Timestamp:
- 2014-05-09T05:32:37+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
r7033 r7082 10 10 import java.io.InputStreamReader; 11 11 import java.io.Reader; 12 import java.nio.charset.StandardCharsets; 12 13 import java.util.ArrayList; 13 14 import java.util.Collection; … … 25 26 import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference; 26 27 import org.openstreetmap.josm.io.MirroredInputStream; 27 import org.openstreetmap.josm.tools.Utils;28 28 import org.openstreetmap.josm.tools.XmlObjectParser; 29 29 import org.xml.sax.SAXException; … … 40 40 */ 41 41 public static final String PRESET_MIME_TYPES = "application/xml, text/xml, text/plain; q=0.8, application/zip, application/octet-stream; q=0.5"; 42 42 43 43 private TaggingPresetReader() { 44 44 // Hide default constructor for utils classes 45 45 } 46 46 47 47 private static File zipIcons = null; 48 48 49 49 /** 50 50 * Returns the set of preset source URLs. … … 70 70 public String ref; 71 71 } 72 72 73 73 public static List<TaggingPreset> readAll(Reader in, boolean validate) throws SAXException { 74 74 XmlObjectParser parser = new XmlObjectParser(); … … 222 222 return all; 223 223 } 224 224 225 225 public static Collection<TaggingPreset> readAll(String source, boolean validate) throws SAXException, IOException { 226 226 Collection<TaggingPreset> tp; … … 233 233 zipIcons = s.getFile(); 234 234 } 235 try (InputStreamReader r = new InputStreamReader(zip == null ? s : zip, Utils.UTF_8)) {235 try (InputStreamReader r = new InputStreamReader(zip == null ? s : zip, StandardCharsets.UTF_8)) { 236 236 tp = readAll(new BufferedReader(r), validate); 237 237 } … … 289 289 return allPresets; 290 290 } 291 291 292 292 /** 293 293 * Reads all tagging presets from sources stored in preferences. … … 299 299 return readAll(getPresetSources(), validate, displayErrMsg); 300 300 } 301 301 302 302 public static File getZipIcons() { 303 303 return zipIcons;
Note:
See TracChangeset
for help on using the changeset viewer.