@Test( expected = KettleException.class ) public void readingStepRepoThrowsExceptionWhenParsingXmlWithBigAmountOfExternalEntities() throws Exception { SerializationHelper.readStepRep( null, repo, null, new ArrayList<>() ); }
public static void readStepRep( Object object, Repository rep, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { String stepXML = rep.getStepAttributeString( id_step, "step-xml" ); ByteArrayInputStream bais = new ByteArrayInputStream( stepXML.getBytes() ); Document doc = XMLParserFactoryProducer.createSecureDocBuilderFactory().newDocumentBuilder().parse( bais ); read( object, doc.getDocumentElement() ); } catch ( ParserConfigurationException ex ) { throw new KettleException( ex.getMessage(), ex ); } catch ( SAXException ex ) { throw new KettleException( ex.getMessage(), ex ); } catch ( IOException ex ) { throw new KettleException( ex.getMessage(), ex ); } }
SerializationHelper { public static void readStepRep( Object object, Repository rep, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { String stepXML = rep.getStepAttributeString( id_step, "step-xml" ); ByteArrayInputStream bais = new ByteArrayInputStream( stepXML.getBytes() ); Document doc = XMLParserFactoryProducer.createSecureDocBuilderFactory().newDocumentBuilder().parse( bais ); read( object, doc.getDocumentElement() ); } catch ( ParserConfigurationException ex ) { throw new KettleException( ex.getMessage(), ex ); } catch ( SAXException ex ) { throw new KettleException( ex.getMessage(), ex ); } catch ( IOException ex ) { throw new KettleException( ex.getMessage(), ex ); } } }
SerializationHelper { public static void readStepRep( Object object, Repository rep, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { String stepXML = rep.getStepAttributeString( id_step, "step-xml" ); ByteArrayInputStream bais = new ByteArrayInputStream( stepXML.getBytes() ); Document doc = XMLParserFactoryProducer.createSecureDocBuilderFactory().newDocumentBuilder().parse( bais ); read( object, doc.getDocumentElement() ); } catch ( ParserConfigurationException ex ) { throw new KettleException( ex.getMessage(), ex ); } catch ( SAXException ex ) { throw new KettleException( ex.getMessage(), ex ); } catch ( IOException ex ) { throw new KettleException( ex.getMessage(), ex ); } }  }
SerializationHelper { public static void readStepRep( Object object, Repository rep, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { String stepXML = rep.getStepAttributeString( id_step, "step-xml" ); ByteArrayInputStream bais = new ByteArrayInputStream( stepXML.getBytes() ); Document doc = XMLParserFactoryProducer.createSecureDocBuilderFactory().newDocumentBuilder().parse( bais ); read( object, doc.getDocumentElement() ); } catch ( ParserConfigurationException ex ) { throw new KettleException( ex.getMessage(), ex ); } catch ( SAXException ex ) { throw new KettleException( ex.getMessage(), ex ); } catch ( IOException ex ) { throw new KettleException( ex.getMessage(), ex ); } }  static void read( Object object, Node node ); @SuppressWarnings( "unchecked" ) static void write( Object object, int indentLevel, StringBuilder buffer ); static void saveJobRep( Object object, Repository rep, ObjectId id_job, ObjectId id_job_entry ); static void readJobRep( Object object, Repository rep, ObjectId id_step, List<DatabaseMeta> databases ); static void saveStepRep( Object object, Repository rep, ObjectId id_transformation, ObjectId id_step ); static void readStepRep( Object object, Repository rep, ObjectId id_step, List<DatabaseMeta> databases ); }
SerializationHelper { public static void readStepRep( Object object, Repository rep, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { String stepXML = rep.getStepAttributeString( id_step, "step-xml" ); ByteArrayInputStream bais = new ByteArrayInputStream( stepXML.getBytes() ); Document doc = XMLParserFactoryProducer.createSecureDocBuilderFactory().newDocumentBuilder().parse( bais ); read( object, doc.getDocumentElement() ); } catch ( ParserConfigurationException ex ) { throw new KettleException( ex.getMessage(), ex ); } catch ( SAXException ex ) { throw new KettleException( ex.getMessage(), ex ); } catch ( IOException ex ) { throw new KettleException( ex.getMessage(), ex ); } }  static void read( Object object, Node node ); @SuppressWarnings( "unchecked" ) static void write( Object object, int indentLevel, StringBuilder buffer ); static void saveJobRep( Object object, Repository rep, ObjectId id_job, ObjectId id_job_entry ); static void readJobRep( Object object, Repository rep, ObjectId id_step, List<DatabaseMeta> databases ); static void saveStepRep( Object object, Repository rep, ObjectId id_transformation, ObjectId id_step ); static void readStepRep( Object object, Repository rep, ObjectId id_step, List<DatabaseMeta> databases );  }