StandardServletMultipartResolver
| Modifier and Type | Class and Description |
|---|---|
| private static class | StandardMultipartHttpServletRequest.StandardMultipartFile
Spring MultipartFile adapter, wrapping a Servlet Part object. |
| Access | Constructor and Description |
|---|---|
| public | StandardMultipartHttpServletRequest(HttpServletRequest
the servlet request to wrap request)Create a new StandardMultipartHttpServletRequest wrapper for the given request, immediately parsing the multipart content. |
| public | StandardMultipartHttpServletRequest(HttpServletRequest
the servlet request to wrap request, boolean whether multipart parsing should be triggered lazily on
first access of multipart files or parameters lazyParsing)Create a new StandardMultipartHttpServletRequest wrapper for the given request. |
| Modifier and Type | Method and Description |
|---|---|
| public String | getMultipartContentType(String
the name of the part paramOrFileName)Implements org. |
| public HttpHeaders | getMultipartHeaders(String paramOrFileName)
Implements org. |
| public Map | getParameterMap()
Overrides jakarta. Implements jakarta. |
| public Enumeration | getParameterNames()
Overrides jakarta. Implements jakarta. Enumeration of String objects containing the names of the parameters
contained in this request.
|
| protected void | |
| protected void | initializeMultipart()
Overrides org. |
| private void |
| multipartParameterNames | back to summary |
|---|---|
| private Set<String> multipartParameterNames
| |
| StandardMultipartHttpServletRequest | back to summary |
|---|---|
| public StandardMultipartHttpServletRequest(HttpServletRequest request) throws MultipartException Create a new StandardMultipartHttpServletRequest wrapper for the given request, immediately parsing the multipart content.
| |
| StandardMultipartHttpServletRequest | back to summary |
|---|---|
| public StandardMultipartHttpServletRequest(HttpServletRequest request, boolean lazyParsing) throws MultipartException Create a new StandardMultipartHttpServletRequest wrapper for the given request.
| |
| getMultipartContentType | back to summary |
|---|---|
| public String getMultipartContentType(String paramOrFileName) Implements org. Doc from org. Determine the content type of the specified request part. | |
| getMultipartHeaders | back to summary |
|---|---|
| public HttpHeaders getMultipartHeaders(String paramOrFileName) Implements org. Doc from org. Return the headers for the specified part of the multipart request. If the underlying implementation supports access to part headers, then all headers are returned. Otherwise, e.g. for a file upload, the returned headers may expose a 'Content-Type' if available.
| |
| getParameterMap | back to summary |
|---|---|
| public Map Overrides jakarta. Implements jakarta. Doc from jakarta. Returns a java.util.Map of the parameters of this request. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data. | |
| getParameterNames | back to summary |
|---|---|
| public Enumeration Overrides jakarta. Implements jakarta. Doc from jakarta. Returns an
| |
| handleParseFailure | back to summary |
|---|---|
| protected void handleParseFailure(Throwable ex) | |
| initializeMultipart | back to summary |
|---|---|
| protected void initializeMultipart() Overrides org. Doc from org. Lazily initialize the multipart request, if possible. Only called if not already eagerly initialized.
| |
| parseRequest | back to summary |
|---|---|
| private void parseRequest(HttpServletRequest request) | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | getBytes()
Implements org. |
| public String | getContentType()
Implements org. |
| public InputStream | getInputStream()
Implements org. |
| public String | getName()
Implements org. |
| public String | getOriginalFilename()
Implements org. |
| public long | getSize()
Implements org. |
| public boolean | isEmpty()
Implements org. |
| public void | transferTo(File
the destination file (typically absolute) dest)Implements org. |
| public void | transferTo(Path dest)
Overrides default org. |
| filename | back to summary |
|---|---|
| private final String filename | |
| part | back to summary |
|---|---|
| private final Part part | |
| StandardMultipartFile | back to summary |
|---|---|
| public StandardMultipartFile(Part part, String filename) | |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes() throws IOException Implements org. Doc from org. Return the contents of the file as an array of bytes.
| |
| getContentType | back to summary |
|---|---|
| public String getContentType() Implements org. Doc from org. Return the content type of the file. | |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Implements org. Doc from org. Return an InputStream to read the contents of the file from. The user is responsible for closing the returned stream.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements org. Doc from org. Return the name of the parameter in the multipart form. | |
| getOriginalFilename | back to summary |
|---|---|
| public String getOriginalFilename() Implements org. Doc from org. Return the original filename in the client's filesystem. This may contain path information depending on the browser used, but it typically will not with any other than Opera. Note Please keep in mind this filename is supplied by the client and should not be used blindly. In addition to not using the directory portion, the file name could also contain characters such as ".." and others that can be used maliciously. It is recommended to not use this filename directly. Preferably generate a unique one and save this one somewhere for reference, if necessary. | |
| getSize | back to summary |
|---|---|
| public long getSize() Implements org. Doc from org. Return the size of the file in bytes.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements org. Doc from org. Return whether the uploaded file is empty, that is, either no file has been chosen in the multipart form or the chosen file has no content.
| |
| transferTo | back to summary |
|---|---|
| public void transferTo(File dest) throws IOException, IllegalStateException Implements org. Doc from org. Transfer the received file to the given destination file. This may either move the file in the filesystem, copy the file in the filesystem, or save memory-held contents to the destination file. If the destination file already exists, it will be deleted first. If the target file has been moved in the filesystem, this operation cannot be invoked again afterwards. Therefore, call this method just once in order to work with any storage mechanism. Note Depending on the underlying provider, temporary storage may be container-dependent, including the base directory for relative destinations specified here (e.g. with Servlet multipart handling). For absolute destinations, the target file may get renamed/moved from its temporary location or newly copied, even if a temporary copy already exists.
| |
| transferTo | back to summary |
|---|---|
| public void transferTo(Path dest) throws IOException, IllegalStateException Overrides default org. Doc from org. Transfer the received file to the given destination file. The default implementation simply copies the file input stream.
| |