throw new BackupExecuteException("Can not get WorkspaceEntry for workspace '" + workspaceName
+ "' from config.", e);
}
JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
JsonValue json;
try
{
json = generatorImpl.createJsonObject(wEntry);
}
catch (JsonException e)
{
throw new BackupExecuteException("Can not get json from : " + wEntry.getClass().toString(), e);
}
response = transport.executePOST(sURL, json.toString());
}
}
else if (repositoryName != null)
{
if (config != null)
{
if (backupId != null)
{
sURL =
path + HTTPBackupAgent.Constants.BASE_URL
+ HTTPBackupAgent.Constants.OperationType.RESTORE_REPOSITORY + "/" + backupId + "/"
+ removeExists;
}
else if (backupSetPath != null)
{
sURL =
path + HTTPBackupAgent.Constants.BASE_URL
+ HTTPBackupAgent.Constants.OperationType.RESTORE_REPOSITORY_BACKUP_SET + "/"
+ removeExists + "?backup-set-path=" + backupSetPathEncoded;
}
RepositoryEntry wEntry = null;
try
{
wEntry = getRepositoryEntry(config, repositoryName);
}
catch (Throwable e) //NOSONAR
{
throw new BackupExecuteException("Can not get RepositoryEntry for repository '" + repositoryName
+ "' from config.", e);
}
JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
JsonValue json;
try
{
json = generatorImpl.createJsonObject(wEntry);
}
catch (JsonException e)
{
throw new BackupExecuteException("Can not get json from : " + wEntry.getClass().toString(), e);
}
response = transport.executePOST(sURL, json.toString());
}
}
else
{
if (backupId != null)