throw new RuntimeException(cause);
}
}
IUnmarshallingContext uctx = factory.createUnmarshallingContext();
RepositoryServiceConfiguration conf =
(RepositoryServiceConfiguration) uctx.unmarshalDocument(PrivilegedFileHelper
.fileInputStream(configFile), null);
if (conf.getRepositoryConfigurations().size() != 1)
{
throw new RepositoryRestoreExeption(
"The oririginal configuration should be contains only one repository entry :"
+ PrivilegedFileHelper.getCanonicalPath(configFile));
}
if (!conf.getRepositoryConfiguration(getBackupConfig().getRepository()).getName().equals(
getBackupConfig().getRepository()))
{
throw new RepositoryRestoreExeption(
"The oririginal configuration should be contains only one repository entry with name \""
+ getBackupConfig().getRepository() + "\" :"
+ PrivilegedFileHelper.getCanonicalPath(configFile));
}
return conf.getRepositoryConfiguration(getBackupConfig().getRepository());
}