DefaultExportHandler implements ExportHandler { @Override public InputStream doExport( RepositoryFile repositoryFile, String filePath ) throws ExportException, IOException { InputStream is = null; final String name = repositoryFile.getName(); final String ext = RepositoryFilenameUtils.getExtension( name ); if ( StringUtils.isEmpty( ext ) ) { log.debug( "Skipping file without extension: " + name ); } if ( converters == null ) { IRepositoryContentConverterHandler converterHandler = PentahoSystem.get( IRepositoryContentConverterHandler.class ); converters = converterHandler.getConverters(); } final Converter converter = converters.get( ext ); if ( converter == null ) { log.debug( "Skipping file without converter: " + name ); return null; } return converter.convert( repositoryFile.getId() ); }  @Override InputStream doExport( RepositoryFile repositoryFile, String filePath ); void setConverters( Map<String, Converter> converters ); void setRepository( IUnifiedRepository repository ); List<String> getLocaleExportList(); void setLocaleExportList( List<String> localeExportList );  }
@Test public void testDoExport() throws Exception { when( repositoryFile.getName() ).thenReturn( "Inventory.prpt" ); String filePath = "/public/pentaho-solutions/steel-wheels/reports/Inventory"; DefaultExportHandler defaultExportHandler = new DefaultExportHandler(); defaultExportHandler.setConverters( converters ); assertEquals( defaultExportHandler.doExport( repositoryFile, filePath ), inputStream ); verify( repositoryFile ).getId(); verify( repositoryFile, atLeast( 1 ) ).getName(); verify( streamConverter ).convert( "1234-1234-12345" ); }