Skip to content

Commit 7c7ef3c

Browse files
committed
Javadoc
1 parent 68a59a8 commit 7c7ef3c

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
* {@link org.apache.commons.io.FileCleaningTracker} when there are files to be tracked. It might make sense to terminate that thread, for example, if your web
5757
* application ends. See the section on "Resource cleanup" in the users guide of commons-fileupload.
5858
* </p>
59+
* <p>
60+
* Although the underlying storage will be deleted automatically when the {@code FileItem} instance is garbage collected, you shouldn't rely on this behavior
61+
* because it is deprecated in Java 18 with <a href="https://openjdk.org/jeps/421">JEP 421: Deprecate Finalization for Removal</a>.
62+
* Use {@link #delete()} to ensure that the underlying storage is deleted.
63+
* </p>
5964
*
6065
* @since FileUpload 1.1
6166
*/

src/main/java/org/apache/commons/fileupload/disk/DiskFileItemFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
* the so-called reaper thread, which is started and stopped automatically by the {@link FileCleaningTracker} when there are files to be tracked. It might make
5151
* sense to terminate that thread, for example, if your web application ends. See the section on "Resource cleanup" in the users guide of commons-fileupload.
5252
* </p>
53+
* <p>
54+
* Although the underlying storage will be deleted automatically when the {@code FileItem} instance is garbage collected, you shouldn't rely on this behavior
55+
* because it is deprecated in Java 18 with <a href="https://openjdk.org/jeps/421">JEP 421: Deprecate Finalization for Removal</a>.
56+
* Use {@link FileItem#delete()} to ensure that the underlying storage is deleted.
57+
* </p>
5358
*
5459
* @since FileUpload 1.1
5560
*/

0 commit comments

Comments
 (0)