namespace = StringUtils.substringBeforeLast( namespace, "/" );
namespace = StringUtils.replaceChars( namespace, '/', '.' );
if ( namespace.endsWith( "." ) ) namespace = StringUtils.chop( namespace );
if ( namespace.startsWith( "." ) ) namespace = StringUtils.substringAfter( namespace, "." );
File file = new File( filename, namespace, null );
String source;
try {
source = FileUtils.readFileToString( jxrSourceFile );
} catch ( IOException e ) {
throw new MojoExecutionException( "IO error during file " + jxrSourceFile.getPath() + " reading", e);
}
FileSource fileSource = new FileSource( source );
fileSource.setFile(file);
file.setFileSource( fileSource );
return file;
}