Example usage for org.springframework.boot.web.client RestTemplateBuilder requestFactory

List of usage examples for org.springframework.boot.web.client RestTemplateBuilder requestFactory

Introduction

In this page you can find the example usage for org.springframework.boot.web.client RestTemplateBuilder requestFactory.

Prototype

Supplier requestFactory

To view the source code for org.springframework.boot.web.client RestTemplateBuilder requestFactory.

Click Source Link

Usage

From source file:software.coolstuff.springframework.owncloud.service.impl.rest.OwncloudRestResourceServiceImpl.java

public OwncloudRestResourceServiceImpl(final RestTemplateBuilder builder,
        final OwncloudRestProperties properties, final SardineCacheLoader sardineCacheLoader,
        final OwncloudRestUserServiceExtension userService) throws MalformedURLException {
    this.properties = properties;
    this.sardineCacheLoader = sardineCacheLoader;
    this.userService = userService;

    URL locationURL = OwncloudRestUtils.checkAndConvertLocation(properties.getLocation());
    this.rootUri = appendOptionalSuffix(locationURL, URI_SUFFIX);
    log.debug("Build the RestTemplate based on Root URI {}", rootUri);
    restTemplate = builder.requestFactory(HttpComponentsClientHttpRequestFactory.class)
            .messageConverters(new ByteArrayHttpMessageConverter()).rootUri(rootUri).build();
}