{
File zipFile = new File((File)context.getObject(DataRestoreContext.STORAGE_DIR), getStorageName() + ".zip");
if (PrivilegedFileHelper.exists(zipFile))
{
return new DirectoryRestore(getIndexDirectory(), zipFile);
}
else
{
// try to check if we have deal with old backup format
zipFile = new File((File)context.getObject(DataRestoreContext.STORAGE_DIR), getStorageName());
if (PrivilegedFileHelper.exists(zipFile))
{
return new DirectoryRestore(getIndexDirectory(), zipFile);
}
else
{
throw new BackupException("There is no backup data for index");
}