public void restoreWorkspace(File workspaceBackupSetDir, boolean asynchronous) throws BackupOperationException,
      BackupConfigurationException
   {
      File[] cfs = PrivilegedFileHelper.listFiles(workspaceBackupSetDir, new BackupLogsFilter());

      if (cfs.length == 0)
      {
         throw new BackupConfigurationException("Can not found workspace backup log in directory : "
            + workspaceBackupSetDir.getPath());
      }

      if (cfs.length > 1)
      {
         throw new BackupConfigurationException("Backup set directory should contains only one workspace backup log : "
            + workspaceBackupSetDir.getPath());
      }

      BackupChainLog backupChainLog = new BackupChainLog(cfs[0]);

      try
      {
         this.restore(backupChainLog, backupChainLog.getBackupConfig().getRepository(), backupChainLog
            .getOriginalWorkspaceEntry(), asynchronous);
      }
      catch (RepositoryException e)
      {
         throw new WorkspaceRestoreException("Workapce \"" + backupChainLog.getOriginalWorkspaceEntry().getName()
            + "\" was not restored in repository \"" + backupChainLog.getBackupConfig().getRepository() + "\"", e);
      }
      catch (RepositoryConfigurationException e)
      {

         throw new WorkspaceRestoreException("Workapce \"" + backupChainLog.getOriginalWorkspaceEntry().getName()
            + "\" was not restored in repository \"" + backupChainLog.getBackupConfig().getRepository() + "\"", e);
      }

   }
public void restoreWorkspace ( File workspaceBackupSetDir , boolean asynchronous ) throws BackupOperationException , BackupConfigurationException { File [ ] cfs = PrivilegedFileHelper . listFiles ( workspaceBackupSetDir , new BackupLogsFilter ( ) ) ; if ( cfs . length == 0 ) { throw new BackupConfigurationException ( "Can not found workspace backup log in directory : " + workspaceBackupSetDir . getPath ( ) ) ; } if ( cfs . length > 1 ) { throw new BackupConfigurationException ( "Backup set directory should contains only one workspace backup log : " + workspaceBackupSetDir . getPath ( ) ) ; } BackupChainLog backupChainLog = new BackupChainLog ( cfs [ 0 ] ) ; try { this . restore ( backupChainLog , backupChainLog . getBackupConfig ( ) . getRepository ( ) , backupChainLog . getOriginalWorkspaceEntry ( ) , asynchronous ) ; } catch ( RepositoryException e ) { throw new WorkspaceRestoreException ( "Workapce \"" + backupChainLog . getOriginalWorkspaceEntry ( ) . getName ( ) + "\" was not restored in repository \"" + backupChainLog . getBackupConfig ( ) . getRepository ( ) + "\"" , e ) ; } catch ( RepositoryConfigurationException e ) { throw new WorkspaceRestoreException ( "Workapce \"" + backupChainLog . getOriginalWorkspaceEntry ( ) . getName ( ) + "\" was not restored in repository \"" + backupChainLog . getBackupConfig ( ) . getRepository ( ) + "\"" , e ) ; } }
{@inheritDoc}