@Controller @ExecuteOn(value="io") public class ZipCreateController extends AbstractCreateController implements ZipCreateOperation
ZipCreateOperation
interface for applications.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MEDIA_TYPE_APPLICATION_ZIP |
projectGenerator
Constructor and Description |
---|
ZipCreateController(ProjectGenerator projectGenerator,
io.micronaut.context.event.ApplicationEventPublisher eventPublisher)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
io.micronaut.http.HttpResponse<io.micronaut.core.io.Writable> |
createApp(ApplicationType type,
@Pattern(regexp="[\\w\\d-_\\.]+") java.lang.String name,
java.util.List<java.lang.String> features,
BuildTool build,
TestFramework test,
Language lang,
JdkVersion javaVersion,
java.lang.String userAgent)
Creates an application, generating a ZIP file as the response.
|
io.micronaut.http.HttpResponse<io.micronaut.core.io.Writable> |
createZip(ApplicationType type,
@Pattern(regexp="[\\w\\d-_]+") @NotBlank java.lang.String name,
java.util.List<java.lang.String> features,
BuildTool build,
TestFramework test,
Language lang,
JdkVersion javaVersion,
java.lang.String userAgent)
Creates the default application type using the name of the given Zip.
|
io.micronaut.http.HttpResponse<io.micronaut.core.io.Writable> |
generateAppIntoZipFile(@NotNull ApplicationType type,
@NotNull java.lang.String name,
java.util.List<java.lang.String> features,
BuildTool buildTool,
TestFramework testFramework,
Language lang,
JdkVersion javaVersion,
java.lang.String userAgent) |
protected java.lang.String |
getFilename(Project project) |
createProjectGeneratorContext, getOperatingSystem
public static final java.lang.String MEDIA_TYPE_APPLICATION_ZIP
public ZipCreateController(ProjectGenerator projectGenerator, io.micronaut.context.event.ApplicationEventPublisher eventPublisher)
projectGenerator
- The project generatoreventPublisher
- The event publisher@Get(uri="/create/{type}/{name}{?features,lang,build,test,javaVersion}", produces="application/zip") public io.micronaut.http.HttpResponse<io.micronaut.core.io.Writable> createApp(ApplicationType type, @Pattern(regexp="[\\w\\d-_\\.]+") @Pattern(regexp="[\\w\\d-_\\.]+") java.lang.String name, @Nullable java.util.List<java.lang.String> features, @Nullable BuildTool build, @Nullable TestFramework test, @Nullable Language lang, @Nullable JdkVersion javaVersion, @Nullable @Header(value="User-Agent") java.lang.String userAgent)
createApp
in interface ZipCreateOperation
type
- The application type The application typename
- The name of the application The name of the applicationfeatures
- The features The chosen featuresbuild
- The build type (optional, defaults to Gradle)test
- The test framework (optional, defaults to JUnit)lang
- The language (optional, defaults to Java)@Get(uri="/{name}.zip{?type,features,lang,build,test}", produces="application/zip") public io.micronaut.http.HttpResponse<io.micronaut.core.io.Writable> createZip(@Bindable(defaultValue="default") ApplicationType type, @Pattern(regexp="[\\w\\d-_]+") @NotBlank @Pattern(regexp="[\\w\\d-_]+") @NotBlank java.lang.String name, @Nullable java.util.List<java.lang.String> features, @Nullable BuildTool build, @Nullable TestFramework test, @Nullable Language lang, @Nullable JdkVersion javaVersion, @Nullable @Header(value="User-Agent") java.lang.String userAgent)
type
- The typename
- The ZIP namefeatures
- The featuresbuild
- The build tooltest
- The test frameworklang
- The languagepublic io.micronaut.http.HttpResponse<io.micronaut.core.io.Writable> generateAppIntoZipFile(@NotNull @NotNull ApplicationType type, @NotNull @NotNull java.lang.String name, @Nullable java.util.List<java.lang.String> features, @Nullable BuildTool buildTool, @Nullable TestFramework testFramework, @Nullable Language lang, @Nullable JdkVersion javaVersion, @Nullable java.lang.String userAgent)
@NonNull protected java.lang.String getFilename(@NonNull Project project)
project
- The project