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

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

Introduction

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

Prototype

URI generateUrl(InitializrServiceMetadata metadata) 

Source Link

Document

Generates the URI to use to generate a project represented by this request.

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
 *//*from w w  w.j  av a 2 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);
}