Example usage for org.springframework.web.multipart.commons CommonsMultipartFile setPreserveFilename

List of usage examples for org.springframework.web.multipart.commons CommonsMultipartFile setPreserveFilename

Introduction

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

Prototype

public void setPreserveFilename(boolean preserveFilename) 

Source Link

Document

Set whether to preserve the filename as sent by the client, not stripping off path information in CommonsMultipartFile#getOriginalFilename() .

Usage

From source file:org.springframework.web.multipart.commons.CommonsFileUploadSupport.java

/**
 * Create a {@link CommonsMultipartFile} wrapper for the given Commons {@link FileItem}.
 * @param fileItem the Commons FileItem to wrap
 * @return the corresponding CommonsMultipartFile (potentially a custom subclass)
 * @since 4.3.5//from   w w w .  j  av  a  2  s . c o m
 * @see #setPreserveFilename(boolean)
 * @see CommonsMultipartFile#setPreserveFilename(boolean)
 */
protected CommonsMultipartFile createMultipartFile(FileItem fileItem) {
    CommonsMultipartFile multipartFile = new CommonsMultipartFile(fileItem);
    multipartFile.setPreserveFilename(this.preserveFilename);
    return multipartFile;
}