@Test public void testReadDataFromInputStream() throws Exception { InputStream inputStream = getClass().getResourceAsStream( "repositories.xml" ); repoMeta.readDataFromInputStream( inputStream ); assertEquals( 1, repoMeta.nrDatabases() ); assertEquals( 1, repoMeta.nrRepositories() ); }
public void readDataFromInputStream( InputStream is ) throws KettleException { clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFactory(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse( is ); parseRepositoriesDoc( doc ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "RepositoryMeta.Error.ReadingInfo" ), e ); } }
RepositoriesMeta { public void readDataFromInputStream( InputStream is ) throws KettleException { clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFactory(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse( is ); parseRepositoriesDoc( doc ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "RepositoryMeta.Error.ReadingInfo" ), e ); } } }
RepositoriesMeta { public void readDataFromInputStream( InputStream is ) throws KettleException { clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFactory(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse( is ); parseRepositoriesDoc( doc ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "RepositoryMeta.Error.ReadingInfo" ), e ); } } RepositoriesMeta(); }
RepositoriesMeta { public void readDataFromInputStream( InputStream is ) throws KettleException { clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFactory(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse( is ); parseRepositoriesDoc( doc ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "RepositoryMeta.Error.ReadingInfo" ), e ); } } RepositoriesMeta(); void clear(); void addDatabase( DatabaseMeta ci ); void addRepository( RepositoryMeta ri ); void addDatabase( int p, DatabaseMeta ci ); void addRepository( int p, RepositoryMeta ri ); DatabaseMeta getDatabase( int i ); RepositoryMeta getRepository( int i ); void removeDatabase( int i ); void removeRepository( int i ); int nrDatabases(); int nrRepositories(); DatabaseMeta searchDatabase( String name ); RepositoryMeta searchRepository( String name ); int indexOfDatabase( DatabaseMeta di ); int indexOfRepository( RepositoryMeta ri ); RepositoryMeta findRepository( String name ); RepositoryMeta findRepositoryById( String id ); boolean readData(); void readDataFromInputStream( InputStream is ); String getXML(); void writeData(); String toString(); RepositoriesMeta clone(); String getErrorMessage(); LogChannelInterface getLog(); }
RepositoriesMeta { public void readDataFromInputStream( InputStream is ) throws KettleException { clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFactory(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse( is ); parseRepositoriesDoc( doc ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "RepositoryMeta.Error.ReadingInfo" ), e ); } } RepositoriesMeta(); void clear(); void addDatabase( DatabaseMeta ci ); void addRepository( RepositoryMeta ri ); void addDatabase( int p, DatabaseMeta ci ); void addRepository( int p, RepositoryMeta ri ); DatabaseMeta getDatabase( int i ); RepositoryMeta getRepository( int i ); void removeDatabase( int i ); void removeRepository( int i ); int nrDatabases(); int nrRepositories(); DatabaseMeta searchDatabase( String name ); RepositoryMeta searchRepository( String name ); int indexOfDatabase( DatabaseMeta di ); int indexOfRepository( RepositoryMeta ri ); RepositoryMeta findRepository( String name ); RepositoryMeta findRepositoryById( String id ); boolean readData(); void readDataFromInputStream( InputStream is ); String getXML(); void writeData(); String toString(); RepositoriesMeta clone(); String getErrorMessage(); LogChannelInterface getLog();  }