This commit is contained in:
Stephane Nicoll
2020-01-01 08:41:11 +01:00
parent cdafc45e14
commit 945b118b0c
9 changed files with 21 additions and 23 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -143,8 +143,8 @@ public class InitializrAutoConfiguration {
@Bean
@ConditionalOnMissingBean
ProjectGenerationController projectGenerationController(InitializrMetadataProvider metadataProvider,
ApplicationContext applicationContext) {
ProjectGenerationController<ProjectRequest> projectGenerationController(
InitializrMetadataProvider metadataProvider, ApplicationContext applicationContext) {
ProjectGenerationInvoker<ProjectRequest> projectGenerationInvoker = new ProjectGenerationInvoker<>(
applicationContext, new DefaultProjectRequestToDescriptionConverter());
return new DefaultProjectGenerationController(metadataProvider, projectGenerationInvoker);
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@ import io.spring.initializr.web.support.Agent.AgentId;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.util.StringUtils;
import org.springframework.web.HttpMediaTypeNotAcceptableException;
import org.springframework.web.accept.ContentNegotiationStrategy;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
@@ -61,7 +60,7 @@ public class InitializrWebConfig implements WebMvcConfigurer {
private final UrlPathHelper urlPathHelper = new UrlPathHelper();
@Override
public List<MediaType> resolveMediaTypes(NativeWebRequest request) throws HttpMediaTypeNotAcceptableException {
public List<MediaType> resolveMediaTypes(NativeWebRequest request) {
String path = this.urlPathHelper
.getPathWithinApplication(request.getNativeRequest(HttpServletRequest.class));
if (!StringUtils.hasText(path) || !path.equals("/")) { // Only care about "/"
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -283,8 +283,7 @@ public class CommandLineHelpGenerator {
private static List<String[]> computeRow(String[][] content, int rowIndex, int maxWidth) {
String[] line = content[rowIndex];
List<String[]> row = HelpFormatter.format(line, maxWidth);
return row;
return HelpFormatter.format(line, maxWidth);
}
private static void appendEmptyRow(StringBuilder sb, int[] columnsLength) {