List of usage examples for org.springframework.boot.cli.command.init ProjectGenerationResponse ProjectGenerationResponse
ProjectGenerationResponse(ContentType contentType)
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; }