Example usage for org.springframework.web.multipart MultipartHttpServletRequest getParts

List of usage examples for org.springframework.web.multipart MultipartHttpServletRequest getParts

Introduction

In this page you can find the example usage for org.springframework.web.multipart MultipartHttpServletRequest getParts.

Prototype

public Collection<Part> getParts() throws IOException, ServletException;

Source Link

Document

Gets all the Part components of this request, provided that it is of type multipart/form-data.

Usage

From source file:org.springframework.web.multipart.support.StandardServletMultipartResolver.java

@Override
public void cleanupMultipart(MultipartHttpServletRequest request) {
    // To be on the safe side: explicitly delete the parts,
    // but only actual file parts (for Resin compatibility)
    try {//from  w  w w.j  av  a  2s  .c o  m
        for (Part part : request.getParts()) {
            if (request.getFile(part.getName()) != null) {
                part.delete();
            }
        }
    } catch (Throwable ex) {
        LogFactory.getLog(getClass()).warn("Failed to perform cleanup of multipart items", ex);
    }
}