in src/main/java/org/apache/maven/doxia/book/services/renderer/LatexBookRenderer.java [66:100]
public void renderBook( BookContext context )
throws BookDoxiaException
{
BookModel book = context.getBook();
if ( !context.getOutputDirectory().exists() )
{
if ( !context.getOutputDirectory().mkdirs() )
{
throw new BookDoxiaException(
"Could not make directory: " + context.getOutputDirectory().getAbsolutePath() + "." );
}
}
File bookFile = new File( context.getOutputDirectory(), book.getId() + ".tex" );
FileWriter fileWriter = null;
try
{
fileWriter = new FileWriter( bookFile );
PrintWriter writer = new PrintWriter( fileWriter );
writeBook( book, context, writer );
}
catch ( IOException e )
{
throw new BookDoxiaException( "Error while opening file.", e );
}
finally
{
IOUtil.close( fileWriter );
}
}