Example usage for org.springframework.boot.cli.command.init ProjectGenerationResponse ProjectGenerationResponse

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

Introduction

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

Prototype

ProjectGenerationResponse(ContentType contentType) 

Source Link

Usage

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

private ProjectGenerationResponse createResponse(CloseableHttpResponse httpResponse, HttpEntity httpEntity)
        throws IOException {
    ProjectGenerationResponse response = new ProjectGenerationResponse(ContentType.getOrDefault(httpEntity));
    response.setContent(FileCopyUtils.copyToByteArray(httpEntity.getContent()));
    String fileName = extractFileName(httpResponse.getFirstHeader("Content-Disposition"));
    if (fileName != null) {
        response.setFileName(fileName);/*from   w ww. ja v a2s .com*/
    }
    return response;
}