Ignore:
Timestamp:
2014-06-14T12:40:50+02:00 (10 years ago)
Author:
bastiK
Message:

reworked MirroredInputStream (renamed to CachedFile):

  • no more awkwardly open and close InputStream if you just want the underlying file (e.g. to get file inside zip file)
  • make it easier to add configuration parameters, without having endless list of parameters for the constructor (Factory style, similar to ImageProvider)

breaks plugins; see #10139

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r7033 r7248  
    2828
    2929import org.openstreetmap.josm.Main;
    30 import org.openstreetmap.josm.io.MirroredInputStream;
     30import org.openstreetmap.josm.io.CachedFile;
    3131import org.xml.sax.Attributes;
    3232import org.xml.sax.ContentHandler;
     
    281281    public Iterable<Object> startWithValidation(final Reader in, String namespace, String schemaSource) throws SAXException {
    282282        SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    283         try (InputStream mis = new MirroredInputStream(schemaSource)) {
     283        try (InputStream mis = new CachedFile(schemaSource).getInputStream()) {
    284284            Schema schema = factory.newSchema(new StreamSource(mis));
    285285            ValidatorHandler validator = schema.newValidatorHandler();
Note: See TracChangeset for help on using the changeset viewer.