private InternalRequest createRequest(
            HttpMethodName httpMethod, AbstractBceRequest request, String...pathVariables) {

        // build URL paths
        List<String> pathComponents = new ArrayList<String>();
        pathComponents.add(VERSION);

        // append resourceKeys,pathVariables,
        // For example:/resourcekey1/resourcekey2/../pathVariable1/pathVariable2
        if (pathVariables != null) {
            for (String pathVariable : pathVariables) {
                pathComponents.add(pathVariable);
            }
        }

        URI uri = HttpUtils.appendUri(getEndpoint(), pathComponents.toArray(new String[pathComponents.size()]));

        // get a InternalRequest instance and set headers
        InternalRequest internalRequest = new InternalRequest(httpMethod, uri);
        internalRequest.setCredentials(request.getRequestCredentials());

        if (httpMethod == HttpMethodName.POST
                || httpMethod == HttpMethodName.PUT) {
            fillRequestPayload(internalRequest, request);
        }
        return internalRequest;
    }
private InternalRequest createRequest ( HttpMethodName httpMethod , AbstractBceRequest request , String ... pathVariables ) { List < String > pathComponents = new ArrayList < String > ( ) ; pathComponents . add ( VERSION ) ; if ( pathVariables != null ) { for ( String pathVariable : pathVariables ) { pathComponents . add ( pathVariable ) ; } } URI uri = HttpUtils . appendUri ( getEndpoint ( ) , pathComponents . toArray ( new String [ pathComponents . size ( ) ] ) ) ; InternalRequest internalRequest = new InternalRequest ( httpMethod , uri ) ; internalRequest . setCredentials ( request . getRequestCredentials ( ) ) ; if ( httpMethod == HttpMethodName . POST || httpMethod == HttpMethodName . PUT ) { fillRequestPayload ( internalRequest , request ) ; } return internalRequest ; }
Creates and initializes a new request object for the specified resource. This method is responsible for
determining HTTP method, URI path, credentials and request body for POST method.
<p>
<b>Note: </b> The Query parameters in URL should be specified by caller method.
</p>

@param httpMethod The HTTP method to use when sending the request.
@param request The original request, as created by the user.
@param pathVariables The optional variables in URI path.
@return A new request object, populated with endpoint, resource path, ready for callers to populate any
additional headers or parameters, and execute.