+ "/" + repositoryName + "/" + workspaceName;
BackupConfigBean bean = new BackupConfigBean(BackupManager.FULL_AND_INCREMENTAL, backupDir, incr);
JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
JsonValue json;
try
{
json = generatorImpl.createJsonObject(bean);
}
catch (JsonException e)
{
throw new BackupExecuteException("Can not get json from : " + bean.getClass().toString(), e);
}
BackupAgentResponse response = transport.executePOST(sURL, json.toString());
if (response.getStatus() == Response.Status.OK.getStatusCode())
{
return "\nSuccessful : \n" + "\tstatus code = " + response.getStatus() + "\n";
}
else
{
return failureProcessing(response);
}
}
else
{
String sURL =
path + HTTPBackupAgent.Constants.BASE_URL
+ HTTPBackupAgent.Constants.OperationType.START_BACKUP_REPOSITORY + "/" + repositoryName;
BackupConfigBean bean = new BackupConfigBean(BackupManager.FULL_AND_INCREMENTAL, backupDir, incr);
JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
JsonValue json;
try
{
json = generatorImpl.createJsonObject(bean);
}
catch (JsonException e)
{
throw new BackupExecuteException("Can not get json from : " + bean.getClass().toString(), e);
}
BackupAgentResponse response = transport.executePOST(sURL, json.toString());
if (response.getStatus() == Response.Status.OK.getStatusCode())
{
return "\nSuccessful : \n" + "\tstatus code = " + response.getStatus() + "\n";
}