package br.unicamp.ic.mc437.g1.configuration;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableAutoConfiguration
@ComponentScan("br.unicamp.ic.mc437.g1")
public class Application extends SpringBootServletInitializer {
	
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(Application.class);
	}
	
	public static void main (String[] args) {
		SpringApplication.run(Application.class, args);
	}

}

@@ -40,16 +40,62 @@
 ation;%0A%0A
+import javax.servlet.MultipartConfigElement;%0A%0A
 import o
@@ -270,24 +270,97 @@
 ionBuilder;%0A
+import org.springframework.boot.context.embedded.MultipartConfigFactory;%0A
 import org.s
@@ -417,24 +417,76 @@
 nitializer;%0A
+import org.springframework.context.annotation.Bean;%0A
 import org.s
@@ -594,16 +594,151 @@
 uration;
+%0Aimport org.springframework.web.multipart.MultipartResolver;%0Aimport org.springframework.web.multipart.commons.CommonsMultipartResolver;
 %0A%0A@Confi
@@ -876,17 +876,16 @@
 lizer %7B%0A
-%09
 %0A%09@Overr
@@ -934,16 +934,20 @@
 nfigure(
+%0A%09%09%09
 SpringAp
@@ -1030,17 +1030,16 @@
 ss);%0A%09%7D%0A
-%09
 %0A%09public
@@ -1055,17 +1055,16 @@
 oid main
- 
 (String%5B
@@ -1127,10 +1127,351 @@
 s);%0A%09%7D%0A%0A
+%09@Bean()%0A%09MultipartConfigElement multipartConfigElement() %7B%0A%09%09MultipartConfigFactory factory = new MultipartConfigFactory();%0A%09%09factory.setMaxFileSize(%221024MB%22);%0A%09%09factory.setMaxRequestSize(%221024MB%22);%0A%09%09return factory.createMultipartConfig();%0A%09%7D%0A%0A%09@Bean()%0A%09MultipartResolver multipartResolver() %7B%0A%09%09return new CommonsMultipartResolver();%0A%09%7D%0A%0A
 %7D%0A

Allow 1GB file upload