Changeset 8287 in josm for trunk/src/org/openstreetmap/josm/tools/Utils.java
- Timestamp:
- 2015-04-28T01:11:18+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r7894 r8287 50 50 import java.util.zip.ZipInputStream; 51 51 52 import javax.xml.XMLConstants; 53 import javax.xml.parsers.ParserConfigurationException; 54 import javax.xml.parsers.SAXParser; 55 import javax.xml.parsers.SAXParserFactory; 56 52 57 import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; 53 58 import org.openstreetmap.josm.Main; 54 59 import org.openstreetmap.josm.data.Version; 60 import org.xml.sax.SAXException; 55 61 56 62 /** … … 1164 1170 return null; 1165 1171 } 1172 1173 /** 1174 * Returns a new secure SAX parser, supporting XML namespaces. 1175 * @return a new secure SAX parser, supporting XML namespaces 1176 * @throws ParserConfigurationException if a parser cannot be created which satisfies the requested configuration. 1177 * @throws SAXException for SAX errors. 1178 * @since 8287 1179 */ 1180 public static SAXParser newSafeSAXParser() throws ParserConfigurationException, SAXException { 1181 SAXParserFactory parserFactory = SAXParserFactory.newInstance(); 1182 parserFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); 1183 parserFactory.setNamespaceAware(true); 1184 return parserFactory.newSAXParser(); 1185 } 1166 1186 }
Note:
See TracChangeset
for help on using the changeset viewer.