Changeset 8347 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2015-05-11T13:50:25+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r8308 r8347 59 59 import org.openstreetmap.josm.Main; 60 60 import org.openstreetmap.josm.data.Version; 61 import org.xml.sax.InputSource; 61 62 import org.xml.sax.SAXException; 63 import org.xml.sax.helpers.DefaultHandler; 62 64 63 65 /** … … 1227 1229 return parserFactory.newSAXParser(); 1228 1230 } 1231 1232 /** 1233 * Parse the content given {@link org.xml.sax.InputSource} as XML using the specified {@link org.xml.sax.helpers.DefaultHandler}. 1234 * This method uses a secure SAX parser, supporting XML namespaces. 1235 * 1236 * @param is The InputSource containing the content to be parsed. 1237 * @param dh The SAX DefaultHandler to use. 1238 * @throws ParserConfigurationException if a parser cannot be created which satisfies the requested configuration. 1239 * @throws SAXException for SAX errors. 1240 * @throws IOException if any IO errors occur. 1241 * @since 8347 1242 */ 1243 public static void parseSafeSAX(InputSource is, DefaultHandler dh) throws ParserConfigurationException, SAXException, IOException { 1244 long start = System.currentTimeMillis(); 1245 if (Main.isDebugEnabled()) { 1246 Main.debug("Starting SAX parsing of "+is+" using "+dh); 1247 } 1248 newSafeSAXParser().parse(is, dh); 1249 if (Main.isDebugEnabled()) { 1250 Main.debug("SAX parsing done in " + getDurationString(System.currentTimeMillis()-start)); 1251 } 1252 } 1229 1253 }
Note:
See TracChangeset
for help on using the changeset viewer.