public static MasterReport loadReport(final Object selectedFile, final ResourceManager resourceManager)
throws ResourceException, IOException
{
final Resource directly = resourceManager.createDirectly(selectedFile, MasterReport.class);
final MasterReport resource = (MasterReport) directly.getResource();
final DocumentBundle bundle = resource.getBundle();
if (bundle == null)
{
// Ok, that should not happen if we work with the engine's parsers, but better safe than sorry.
final MemoryDocumentBundle documentBundle = new MemoryDocumentBundle(resource.getContentBase());
documentBundle.getWriteableDocumentMetaData().setBundleType(ClassicEngineBoot.BUNDLE_TYPE);