public class WxMultipartFile extends Object implements org.springframework.web.multipart.MultipartFile, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
WxMultipartFile(org.apache.tomcat.util.http.fileupload.FileItem fileItem)
Create an instance wrapping the given FileItem.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytes() |
String |
getContentType() |
org.apache.tomcat.util.http.fileupload.FileItem |
getFileItem()
Return the underlying
org.apache.commons.fileupload.FileItem
instance. |
InputStream |
getInputStream() |
String |
getName() |
String |
getOriginalFilename() |
long |
getSize() |
String |
getStorageDescription()
Return a description for the storage location of the multipart content.
|
protected boolean |
isAvailable()
Determine whether the multipart content is still available.
|
boolean |
isEmpty() |
void |
setPreserveFilename(boolean preserveFilename)
Set whether to preserve the filename as sent by the client, not stripping off
path information in
getOriginalFilename(). |
void |
transferTo(File dest) |
public WxMultipartFile(org.apache.tomcat.util.http.fileupload.FileItem fileItem)
fileItem - the FileItem to wrappublic final org.apache.tomcat.util.http.fileupload.FileItem getFileItem()
org.apache.commons.fileupload.FileItem
instance. There is hardly any need to access this.public void setPreserveFilename(boolean preserveFilename)
getOriginalFilename().
Default is "false", stripping off path information that may prefix the actual filename e.g. from Opera. Switch this to "true" for preserving the client-specified filename as-is, including potential path separators.
getOriginalFilename(),
CommonsFileUploadSupport.setPreserveFilename(boolean)public String getName()
getName in interface org.springframework.web.multipart.MultipartFilepublic String getOriginalFilename()
getOriginalFilename in interface org.springframework.web.multipart.MultipartFilepublic String getContentType()
getContentType in interface org.springframework.web.multipart.MultipartFilepublic boolean isEmpty()
isEmpty in interface org.springframework.web.multipart.MultipartFilepublic long getSize()
getSize in interface org.springframework.web.multipart.MultipartFilepublic byte[] getBytes()
getBytes in interface org.springframework.web.multipart.MultipartFilepublic InputStream getInputStream() throws IOException
getInputStream in interface org.springframework.core.io.InputStreamSourcegetInputStream in interface org.springframework.web.multipart.MultipartFileIOExceptionpublic void transferTo(File dest) throws IOException, IllegalStateException
transferTo in interface org.springframework.web.multipart.MultipartFileIOExceptionIllegalStateExceptionprotected boolean isAvailable()
public String getStorageDescription()
Copyright © 2018 Guangshan Technology, Inc.. All rights reserved.