mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix to transfer status since the "error" JSON property is optional.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22463 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -547,14 +547,19 @@ public class HttpClientTransmitterImpl implements TransferTransmitter
|
|||||||
int endPosition = statusObj.getInt("endPosition");
|
int endPosition = statusObj.getInt("endPosition");
|
||||||
String statusStr= statusObj.getString("status");
|
String statusStr= statusObj.getString("status");
|
||||||
|
|
||||||
|
TransferProgress p = new TransferProgress();
|
||||||
|
|
||||||
|
if(statusObj.has("error"))
|
||||||
|
{
|
||||||
JSONObject errorJSON = statusObj.getJSONObject("error");
|
JSONObject errorJSON = statusObj.getJSONObject("error");
|
||||||
Throwable throwable = rehydrateError(errorJSON);
|
Throwable throwable = rehydrateError(errorJSON);
|
||||||
|
p.setError(throwable);
|
||||||
|
}
|
||||||
|
|
||||||
TransferProgress p = new TransferProgress();
|
|
||||||
p.setStatus(TransferProgress.Status.valueOf(statusStr));
|
p.setStatus(TransferProgress.Status.valueOf(statusStr));
|
||||||
p.setCurrentPosition(currentPosition);
|
p.setCurrentPosition(currentPosition);
|
||||||
p.setEndPosition(endPosition);
|
p.setEndPosition(endPosition);
|
||||||
p.setError(throwable);
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
catch (RuntimeException e)
|
catch (RuntimeException e)
|
||||||
|
Reference in New Issue
Block a user