private InternalRequest createRequest ( AbstractBceRequest bceRequest , HttpMethodName httpMethod ) { String bucketName = null ; String key = null ; // when custom_endpoint, bucketName should be null when set up InternalRequest. if ( bceRequest instanceof GenericBucketRequest && ! ( ( BosClientConfiguration ) this . config ) . isCnameEnabled ( ) ) { bucketName = ( ( GenericBucketRequest ) bceRequest ) . getBucketName ( ) ; } if ( bceRequest instanceof GenericObjectRequest ) { key = ( ( GenericObjectRequest ) bceRequest ) . getKey ( ) ; } InternalRequest request = new InternalRequest ( httpMethod , HttpUtils . appendUri ( this . getEndpoint ( ) , URL_PREFIX , bucketName , key ) ) ; request . setCredentials ( bceRequest . getRequestCredentials ( ) ) ; return request ; }
Creates and initializes a new request object for the specified Bos resource . This method is responsible for determining the right way to address resources .