Example usage for org.springframework.web.multipart.commons CommonsMultipartResolver setResolveLazily

List of usage examples for org.springframework.web.multipart.commons CommonsMultipartResolver setResolveLazily

Introduction

In this page you can find the example usage for org.springframework.web.multipart.commons CommonsMultipartResolver setResolveLazily.

Prototype

public void setResolveLazily(boolean resolveLazily) 

Source Link

Document

Set whether to resolve the multipart request lazily at the time of file or parameter access.

Usage

From source file:com.epam.ta.reportportal.core.configs.MvcConfig.java

@Bean
public CommonsMultipartResolver multipartResolver(MultipartConfig multipartConfig) {
    CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();

    //Lazy resolving gives a way to process file limits inside a controller
    //level and handle exceptions in proper way. Fixes reportportal/reportportal#19
    commonsMultipartResolver.setResolveLazily(true);

    commonsMultipartResolver.setMaxUploadSize(multipartConfig.maxUploadSize);
    commonsMultipartResolver.setMaxUploadSizePerFile(multipartConfig.maxFileSize);
    return commonsMultipartResolver;
}