R
- the ProjectRequest
type to use to bind request parameters@Controller public abstract class ProjectGenerationController<R extends ProjectRequest> extends Object
Controller
that provides endpoints for project generation.Constructor and Description |
---|
ProjectGenerationController(InitializrMetadataProvider metadataProvider,
ProjectGenerationInvoker<R> projectGenerationInvoker) |
Modifier and Type | Method and Description |
---|---|
protected InitializrMetadata |
getMetadata() |
org.springframework.http.ResponseEntity<byte[]> |
gradle(R request) |
void |
invalidProjectRequest(HttpServletResponse response,
InvalidProjectRequestException ex) |
org.springframework.http.ResponseEntity<byte[]> |
pom(R request) |
abstract R |
projectRequest(Map<String,String> headers)
Create an initialized
ProjectRequest instance to use to bind the parameters
of a project generation request. |
org.springframework.http.ResponseEntity<byte[]> |
springTgz(R request) |
org.springframework.http.ResponseEntity<byte[]> |
springZip(R request) |
public ProjectGenerationController(InitializrMetadataProvider metadataProvider, ProjectGenerationInvoker<R> projectGenerationInvoker)
public abstract R projectRequest(@RequestHeader Map<String,String> headers)
ProjectRequest
instance to use to bind the parameters
of a project generation request.headers
- the headers of the requestProjectRequest
instanceprotected InitializrMetadata getMetadata()
@ExceptionHandler public void invalidProjectRequest(HttpServletResponse response, InvalidProjectRequestException ex) throws IOException
IOException
@RequestMapping(path={"/pom","/pom.xml"}) public org.springframework.http.ResponseEntity<byte[]> pom(R request)
@RequestMapping(path={"/build","/build.gradle"}) public org.springframework.http.ResponseEntity<byte[]> gradle(R request)
@RequestMapping(value="/starter.zip") public org.springframework.http.ResponseEntity<byte[]> springZip(R request) throws IOException
IOException
@RequestMapping(path="/starter.tgz", produces="application/x-compress") public org.springframework.http.ResponseEntity<byte[]> springTgz(R request) throws IOException
IOException
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.