11/*
2- * Copyright 2002-2016 the original author or authors.
2+ * Copyright 2002-2017 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2727 *
2828 * <p>The file contents are either stored in memory or temporarily on disk.
2929 * In either case, the user is responsible for copying file contents to a
30- * session-level or persistent store as and if desired. The temporary storages
30+ * session-level or persistent store as and if desired. The temporary storage
3131 * will be cleared at the end of request processing.
3232 *
3333 * @author Juergen Hoeller
@@ -50,6 +50,8 @@ public interface MultipartFile extends InputStreamSource {
5050 * but it typically will not with any other than Opera.
5151 * @return the original filename, or the empty String if no file has been chosen
5252 * in the multipart form, or {@code null} if not defined or not available
53+ * @see org.apache.commons.fileupload.FileItem#getName()
54+ * @see org.springframework.web.multipart.commons.CommonsMultipartFile#setPreserveFilename
5355 */
5456 String getOriginalFilename ();
5557
@@ -81,7 +83,7 @@ public interface MultipartFile extends InputStreamSource {
8183
8284 /**
8385 * Return an InputStream to read the contents of the file from.
84- * The user is responsible for closing the stream.
86+ * <p> The user is responsible for closing the returned stream.
8587 * @return the contents of the file as stream, or an empty stream if empty
8688 * @throws IOException in case of access errors (if the temporary store fails)
8789 */
@@ -91,18 +93,22 @@ public interface MultipartFile extends InputStreamSource {
9193 /**
9294 * Transfer the received file to the given destination file.
9395 * <p>This may either move the file in the filesystem, copy the file in the
94- * filesystem, or save memory-held contents to the destination file.
95- * If the destination file already exists, it will be deleted first.
96- * <p>If the file has been moved in the filesystem, this operation cannot
97- * be invoked again. Therefore, call this method just once to be able to
98- * work with any storage mechanism.
99- * <p><strong>Note:</strong> when using Servlet 3.0 multipart support you
100- * need to configure the location relative to which files will be copied
101- * as explained in {@link javax.servlet.http.Part#write}.
102- * @param dest the destination file
96+ * filesystem, or save memory-held contents to the destination file. If the
97+ * destination file already exists, it will be deleted first.
98+ * <p>If the target file has been moved in the filesystem, this operation
99+ * cannot be invoked again afterwards. Therefore, call this method just once
100+ * in order to work with any storage mechanism.
101+ * <p><b>NOTE:</b> Depending on the underlying provider, temporary storage
102+ * may be container-dependent, including the base directory for relative
103+ * destinations specified here (e.g. with Servlet 3.0 multipart handling).
104+ * For absolute destinations, the target file may get renamed/moved from its
105+ * temporary location or newly copied, even if a temporary copy already exists.
106+ * @param dest the destination file (typically absolute)
103107 * @throws IOException in case of reading or writing errors
104108 * @throws IllegalStateException if the file has already been moved
105109 * in the filesystem and is not available anymore for another transfer
110+ * @see org.apache.commons.fileupload.FileItem#write(File)
111+ * @see javax.servlet.http.Part#write(String)
106112 */
107113 void transferTo (File dest ) throws IOException , IllegalStateException ;
108114
0 commit comments