public TransferResponse onCompleted(Response response) throws Exception {
try {
// consume content and process it
String body = response.getResponseBody();
// try to parse the body
TransferResponse transferResponse = ProtocolFactory.parseTransferResponse(body);
// check if the response is valid
ProtocolResponseUtil.verifyResultCodeIsOK(transferResponse);
if (handler != null) handler.onComplete(transferResponse);
return transferResponse;
} catch (Exception e) {