Package org.springframework.boot.context.embedded

Examples of org.springframework.boot.context.embedded.MultipartConfigFactory


  @Configuration
  protected static class MultipartConfiguration {

    @Bean
    public MultipartConfigElement multipartConfig() {
      MultipartConfigFactory factory = new MultipartConfigFactory();
      factory.setMaxFileSize("128KB");
      factory.setMaxRequestSize("128KB");
      return factory.createMultipartConfig();
    }
View Full Code Here


  /**
   * Create a new {@link MultipartConfigElement} using the
   * @return a new {@link MultipartConfigElement} configured using there properties
   */
  public MultipartConfigElement createMultipartConfig() {
    MultipartConfigFactory factory = new MultipartConfigFactory();
    if (StringUtils.hasText(this.fileSizeThreshold)) {
      factory.setFileSizeThreshold(this.fileSizeThreshold);
    }
    if (StringUtils.hasText(this.location)) {
      factory.setLocation(this.location);
    }
    if (StringUtils.hasText(this.maxRequestSize)) {
      factory.setMaxRequestSize(this.maxRequestSize);
    }
    if (StringUtils.hasText(this.maxFileSize)) {
      factory.setMaxFileSize(this.maxFileSize);
    }
    return factory.createMultipartConfig();
  }
View Full Code Here

TOP

Related Classes of org.springframework.boot.context.embedded.MultipartConfigFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.