for (ValueStorageEntry valueStorage : wsConfig.getContainer().getValueStorages())
{
File srcDir = new File(valueStorage.getParameterValue(FileValueStorage.PATH));
if (!PrivilegedFileHelper.exists(srcDir))
{
throw new BackupException("Can't backup value storage. Directory " + srcDir.getName()
+ " doesn't exists");
}
else
{
File destValuesDir = new File(storageDir, "values");
File destDir = new File(destValuesDir, valueStorage.getId());
DirectoryHelper.compressDirectory(srcDir, destDir);
}
}
}
}
catch (IOException e)
{
throw new BackupException(e);
}
catch (RepositoryConfigurationException e)
{
throw new BackupException(e);
}
catch (RepositoryException e)
{
throw new BackupException(e);
}
finally
{
if (backupInfo != null)
{
try
{
backupInfo.close();
}
catch (IOException e)
{
throw new BackupException(e);
}
}
}
}