Example usage for org.springframework.boot.cli.command.init ProjectGenerationRequest getServiceUrl

List of usage examples for org.springframework.boot.cli.command.init ProjectGenerationRequest getServiceUrl

Introduction

In this page you can find the example usage for org.springframework.boot.cli.command.init ProjectGenerationRequest getServiceUrl.

Prototype

String getServiceUrl() 

Source Link

Document

The URL of the service to use.

Usage

From source file:org.springframework.boot.cli.command.init.InitializrService.java

/**
 * Generate a project based on the specified {@link ProjectGenerationRequest}.
 * @param request the generation request
 * @return an entity defining the project
 * @throws IOException if generation fails
 *//* w  ww. j  a  v a2  s.  co m*/
public ProjectGenerationResponse generate(ProjectGenerationRequest request) throws IOException {
    Log.info("Using service at " + request.getServiceUrl());
    InitializrServiceMetadata metadata = loadMetadata(request.getServiceUrl());
    URI url = request.generateUrl(metadata);
    CloseableHttpResponse httpResponse = executeProjectGenerationRequest(url);
    HttpEntity httpEntity = httpResponse.getEntity();
    validateResponse(httpResponse, request.getServiceUrl());
    return createResponse(httpResponse, httpEntity);
}