dataDirectory.mkdirs();
}
final FileRepository dataRepository = new FileRepository( dataDirectory );
dataLocation = dataRepository.getRoot();
dataNameGenerator = new DefaultNameGenerator( dataLocation );
rewriter = new PentahoURLRewriter( htmlContentHandlerUrlPattern );
} else {
dataLocation = null;
dataNameGenerator = null;
rewriter = new PentahoURLRewriter( htmlContentHandlerUrlPattern );
}
final StreamRepository targetRepository = new StreamRepository( null, outputStream );
final ContentLocation targetRoot = targetRepository.getRoot();
final HtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor( report.getConfiguration() );
final HtmlPrinter printer = new AllItemsHtmlPrinter( report.getResourceManager() );
printer.setContentWriter( targetRoot, new DefaultNameGenerator( targetRoot, "index", "html" ) ); //$NON-NLS-1$//$NON-NLS-2$
printer.setDataWriter( dataLocation, dataNameGenerator );
printer.setUrlRewriter( rewriter );
outputProcessor.setPrinter( printer );
final StreamReportProcessor sp = new StreamReportProcessor( report, outputProcessor );