protected String buildContextURL(ODataRequestContext requestContext, Object data) throws ODataRenderException {
        ODataUri oDataUri = requestContext.getUri();
        if (ODataUriUtil.isActionCallUri(oDataUri) || ODataUriUtil.isFunctionCallUri(oDataUri)) {
            return buildContextUrlFromOperationCall(oDataUri, requestContext.getEntityDataModel(),
                    isListOrStream(data));
        }

        Option<String> contextURL;
        if (isWriteOperation(requestContext)) {
            contextURL = getContextUrlWriteOperation(oDataUri);
        } else {
            contextURL = getContextUrl(oDataUri);
        }
        checkContextURL(requestContext, contextURL);
        return contextURL.get();
    }
protected String buildContextURL ( ODataRequestContext requestContext , Object data ) throws ODataRenderException { ODataUri oDataUri = requestContext . getUri ( ) ; if ( ODataUriUtil . isActionCallUri ( oDataUri ) || ODataUriUtil . isFunctionCallUri ( oDataUri ) ) { return buildContextUrlFromOperationCall ( oDataUri , requestContext . getEntityDataModel ( ) , isListOrStream ( data ) ) ; } Option < String > contextURL ; if ( isWriteOperation ( requestContext ) ) { contextURL = getContextUrlWriteOperation ( oDataUri ) ; } else { contextURL = getContextUrl ( oDataUri ) ; } checkContextURL ( requestContext , contextURL ) ; return contextURL . get ( ) ; }
Build the 'Context URL' from a given OData request context.

@param requestContext The given OData request context
@param data           Result data
@return The built 'Context URL'
@throws ODataRenderException If unable to build context url