throw new MojoExecutionException( "Unable to copy hardcoded mimetype file", e );
}
try
{
ZipArchiver zipArchiver = (ZipArchiver)archiverManager.getArchiver("zip");
zipArchiver.addDirectory(targetDirectory);
zipArchiver.setCompress( true ); // seems to not be a problem to have mimetype compressed
zipArchiver.setDestFile( new File(targetDirectory.getParentFile(), result.getName())); // copy it to parent dir
zipArchiver.createArchive( );
getLog( ).debug( "epub file created at: " + zipArchiver.getDestFile( ).getAbsolutePath( ) );
} catch ( Exception e )
{
throw new MojoExecutionException( "Unable to zip epub file", e );
}
}