private void fullRestoreOverInitializer(String pathBackupFile, String repositoryName, WorkspaceEntry workspaceEntry,
String fBackupType) throws FileNotFoundException, IOException, RepositoryException,
RepositoryConfigurationException, ClassNotFoundException
{
WorkspaceInitializerEntry wieOriginal = workspaceEntry.getInitializer();
RepositoryImpl defRep = (RepositoryImpl)repoService.getRepository(repositoryName);
WorkspaceInitializerEntry wiEntry = new WorkspaceInitializerEntry();
if ((Tools.forName(fBackupType, this).equals(FullBackupJob.class)))
{
// set the initializer SysViewWorkspaceInitializer
wiEntry.setType(SysViewWorkspaceInitializer.class.getCanonicalName());
List<SimpleParameterEntry> wieParams = new ArrayList<SimpleParameterEntry>();
wieParams.add(new SimpleParameterEntry(SysViewWorkspaceInitializer.RESTORE_PATH_PARAMETER, pathBackupFile));
wiEntry.setParameters(wieParams);
}
else if ((Tools.forName(fBackupType, this)
.equals(org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class)))
{
// set the initializer RdbmsWorkspaceInitializer
wiEntry.setType(RdbmsWorkspaceInitializer.class.getCanonicalName());
List<SimpleParameterEntry> wieParams = new ArrayList<SimpleParameterEntry>();
wieParams.add(new SimpleParameterEntry(RdbmsWorkspaceInitializer.RESTORE_PATH_PARAMETER, new File(
pathBackupFile).getParent()));
wiEntry.setParameters(wieParams);
}
workspaceEntry.setInitializer(wiEntry);
//restore