Example usage for org.springframework.web.multipart MultipartException getCause

List of usage examples for org.springframework.web.multipart MultipartException getCause

Introduction

In this page you can find the example usage for org.springframework.web.multipart MultipartException getCause.

Prototype

public synchronized Throwable getCause() 

Source Link

Document

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

Usage

From source file:org.codehaus.groovy.grails.web.multipart.ContentLengthAwareCommonsMultipartResolver.java

@SuppressWarnings("deprecation")
@Override//  www .  j  a v a 2 s.  com
protected MultipartParsingResult parseRequest(HttpServletRequest request) throws MultipartException {
    try {
        return super.parseRequest(request);
    } catch (MultipartException e) {
        if (e.getCause() != null && e.getCause().getClass().equals(FileUploadBase.UnknownSizeException.class)) {
            LOG.warn(e.getMessage());
            Map<String, String[]> emptyMpParams = Collections.emptyMap();
            Map<String, String> emptyMpParamContentTypes = Collections.emptyMap();
            return new MultipartParsingResult(EMPTY_MULTI_VALUE_MAP, emptyMpParams, emptyMpParamContentTypes);
        }
        throw e;
    }
}