private static TransferImageResponse checkTransferImageResponse(TransferImageResponse transferImageResponse) throws RpcException {
  logger.info("Checking {}",transferImageResponse);
switch (transferImageResponse.getResult()) {
case OK:
    break;
case TRANSFER_IN_PROGRESS:
  throw new ImageTransferInProgressException(transferImageResponse.getError());
case SYSTEM_ERROR:
throw new SystemErrorException(transferImageResponse.getError());
default :
throw new RpcException(String.format("Unexpected result: %s",transferImageResponse.getResult()));
}
return transferImageResponse;
}

private static TransferImageResponse checkTransferImageResponse ( TransferImageResponse transferImageResponse ) throws RpcException { logger . info ( "Checking {}" , transferImageResponse ) ; switch ( transferImageResponse . getResult ( ) ) { case OK : break ; case TRANSFER_IN_PROGRESS : throw new ImageTransferInProgressException ( transferImageResponse . getError ( ) ) ; case SYSTEM_ERROR : throw new SystemErrorException ( transferImageResponse . getError ( ) ) ; default : throw new RpcException ( String . format ( "Unexpected result: %s" , transferImageResponse . getResult ( ) ) ) ; } return transferImageResponse ; }
this method validates a transferimageresponse object , raising an exception if the response reflects an operation failure .
