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

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

Introduction

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

Prototype

void setFileName(String fileName) 

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  www . ja  v  a2 s .com
    return response;
}