@RestController
@CrossOrigin(origins="*")
@RequestMapping(value="/api/v1/zip")
public class ZipController
extends java.lang.Object
| Constructor and Description |
|---|
ZipController(ZipService injectedZipService,
ConfigurationHandler injectedConfigurationHandler,
NotificationResponse injectedNotificationResponse)
Constructor responsible for DI.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<java.lang.String> |
handleFileUpload(org.springframework.web.multipart.MultipartFile file)
Upload a file and check whether it is a ServerPackCreator valid ZIP-archive.
|
org.springframework.http.ResponseEntity<java.lang.String> |
requestGenerationFromZip(java.lang.String zipName,
java.lang.String clientMods,
java.lang.String minecraftVersion,
java.lang.String modLoader,
java.lang.String modLoaderVersion,
boolean installModloaderServer)
Request the generation of a server pack from a previously uploaded ZIP-archive, which passed validation checks,
and from a barebones configuration, including:
clientModsminecraftVersionmodLoadermodLoaderVersioninstallModloaderServer |
@Autowired public ZipController(ZipService injectedZipService, ConfigurationHandler injectedConfigurationHandler, NotificationResponse injectedNotificationResponse)
injectedZipService - Instance of ZipService.injectedConfigurationHandler - Instance of ConfigurationHandler.injectedNotificationResponse - Instance of NotificationResponse.@PostMapping(value="/upload")
public org.springframework.http.ResponseEntity<java.lang.String> handleFileUpload(@RequestParam(value="file")
org.springframework.web.multipart.MultipartFile file)
throws java.io.IOException
file - MultipartFile The file uploaded to ServerPackCreator.java.io.IOException - if an errors occurred saving or reading the file.@GetMapping(value="/{zipName}&{clientMods}&{minecraftVersion}&{modLoader}&{modLoaderVersion}&{installModloaderServer}")
public org.springframework.http.ResponseEntity<java.lang.String> requestGenerationFromZip(@PathVariable(value="zipName")
java.lang.String zipName,
@PathVariable(value="clientMods")
java.lang.String clientMods,
@PathVariable(value="minecraftVersion")
java.lang.String minecraftVersion,
@PathVariable(value="modLoader")
java.lang.String modLoader,
@PathVariable(value="modLoaderVersion")
java.lang.String modLoaderVersion,
@PathVariable(value="installModloaderServer")
boolean installModloaderServer)
clientModsminecraftVersionmodLoadermodLoaderVersioninstallModloaderServerzipName - String The name of the previously uploaded ZIP-archive.clientMods - String A comma separated list of clientside-only mods to exclude from the server pack.minecraftVersion - String The Minecraft version the modpack, and therefor the server pack, uses.modLoader - String The modloader the modpack, and therefor the server pack, uses.modLoaderVersion - String The modloader version the modpack, and therefor the server pack, uses.installModloaderServer - Boolean Whether to install the modloader server in the server pack.NotificationResponse with information about the result.