*/
private String getGeneratedDocumentTitle( final File f )
throws IOException
{
final IndexEntry entry = new IndexEntry( "index" );
final IndexingSink titleSink = new IndexingSink( entry );
Reader reader = null;
try
{
reader = ReaderFactory.newXmlReader( f );
doxia.parse( reader, f.getParentFile().getName(), titleSink );
}
catch ( ParseException e )
{
if ( getLog().isDebugEnabled() )
{
getLog().error( "ParseException: " + e.getMessage(), e );
}
else
{
getLog().error( "ParseException: " + e.getMessage() );
}
return null;
}
catch ( ParserNotFoundException e )
{
if ( getLog().isDebugEnabled() )
{
getLog().error( "ParserNotFoundException: " + e.getMessage(), e );
}
else
{
getLog().error( "ParserNotFoundException: " + e.getMessage() );
}
return null;
}
finally
{
IOUtil.close( reader );
}
return titleSink.getTitle();
}