public class CommonsMultipartFile extends Object implements org.springframework.web.multipart.MultipartFile, Serializable
MultipartFile implementation for Apache Commons FileUpload.| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.apache.commons.logging.Log |
logger |
| 构造器和说明 |
|---|
CommonsMultipartFile(org.apache.commons.fileupload.FileItem fileItem)
Create an instance wrapping the given FileItem.
|
| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
getBytes() |
String |
getContentType() |
org.apache.commons.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) |
void |
transferTo(Path dest) |
public CommonsMultipartFile(org.apache.commons.fileupload.FileItem fileItem)
fileItem - the FileItem to wrappublic final org.apache.commons.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()public String getName()
getName 在接口中 org.springframework.web.multipart.MultipartFilepublic String getOriginalFilename()
getOriginalFilename 在接口中 org.springframework.web.multipart.MultipartFilepublic String getContentType()
getContentType 在接口中 org.springframework.web.multipart.MultipartFilepublic boolean isEmpty()
isEmpty 在接口中 org.springframework.web.multipart.MultipartFilepublic long getSize()
getSize 在接口中 org.springframework.web.multipart.MultipartFilepublic byte[] getBytes()
getBytes 在接口中 org.springframework.web.multipart.MultipartFilepublic InputStream getInputStream() throws IOException
getInputStream 在接口中 org.springframework.core.io.InputStreamSourcegetInputStream 在接口中 org.springframework.web.multipart.MultipartFileIOExceptionpublic void transferTo(File dest) throws IOException, IllegalStateException
transferTo 在接口中 org.springframework.web.multipart.MultipartFileIOExceptionIllegalStateExceptionpublic void transferTo(Path dest) throws IOException, IllegalStateException
transferTo 在接口中 org.springframework.web.multipart.MultipartFileIOExceptionIllegalStateExceptionprotected boolean isAvailable()
public String getStorageDescription()
Copyright © 2025 onecode. All rights reserved.