try
{
if (!backupSetDir.exists())
{
throw new RestoreConfigurationException("Backup set directory is not exists :" + backupSetPath);
}
if (!backupSetDir.isDirectory())
{
throw new RestoreConfigurationException("Backup set directory is not directory :" + backupSetPath);
}
File[] cfsw = PrivilegedFileHelper.listFiles(backupSetDir, new BackupLogsFilter());
File[] cfsr = PrivilegedFileHelper.listFiles(backupSetDir, new RepositoryBackupLogsFilter());
if (cfsw.length == 0 && cfsr.length == 0)
{
throw new RestoreConfigurationException("Can not found backup log in directory : " + backupSetPath);
}
else if ((cfsw.length == 1 && cfsr.length == 1) || (cfsw.length > 1) || (cfsr.length > 1))
{
throw new RestoreConfigurationException("Backup set directory should contains only one backup log : "
+ backupSetPath);
}
else if (cfsw.length != 0 && cfsr.length == 0)
{
restoreWorkspace = true;