You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2026/04/10 12:26:39 UTC

(commons-fileupload) branch 1.x updated: Javadoc

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch 1.x
in repository https://gitbox.apache.org/repos/asf/commons-fileupload.git


The following commit(s) were added to refs/heads/1.x by this push:
     new b8b7a15a Javadoc
b8b7a15a is described below

commit b8b7a15ad09b8da4e73306936b45f27f3d94042d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Apr 10 08:26:34 2026 -0400

    Javadoc
---
 .../java/org/apache/commons/fileupload/DefaultFileItem.java  |  3 ++-
 .../apache/commons/fileupload/DefaultFileItemFactory.java    | 10 +++-------
 .../org/apache/commons/fileupload/disk/DiskFileItem.java     | 11 +++++------
 .../apache/commons/fileupload/disk/DiskFileItemFactory.java  | 12 +++++++++---
 4 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/src/main/java/org/apache/commons/fileupload/DefaultFileItem.java b/src/main/java/org/apache/commons/fileupload/DefaultFileItem.java
index 6b7d504b..575b480b 100644
--- a/src/main/java/org/apache/commons/fileupload/DefaultFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload/DefaultFileItem.java
@@ -43,7 +43,8 @@ public class DefaultFileItem extends DiskFileItem {
      * @param isFormField   Whether or not this item is a plain form field, as opposed to a file upload.
      * @param fileName      The original file name in the user's file system, or {@code null} if not specified.
      * @param sizeThreshold The threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file.
-     * @param repository    The data repository, which is the directory in which files will be created, should the item size exceed the threshold.
+     * @param repository    The data repository, which is the directory in which files will be created, should the item size exceed the threshold. If
+     *                      {@code null}, the system default temporary directory in the system property {@code java.io.tmpdir} is used.
      * @deprecated 1.1 Use {@code DiskFileItem} instead.
      */
     @Deprecated
diff --git a/src/main/java/org/apache/commons/fileupload/DefaultFileItemFactory.java b/src/main/java/org/apache/commons/fileupload/DefaultFileItemFactory.java
index f18efe28..17db4722 100644
--- a/src/main/java/org/apache/commons/fileupload/DefaultFileItemFactory.java
+++ b/src/main/java/org/apache/commons/fileupload/DefaultFileItemFactory.java
@@ -55,13 +55,9 @@ public class DefaultFileItemFactory extends DiskFileItemFactory {
     /**
      * Constructs a preconfigured instance of this class.
      *
-     * @param sizeThreshold The threshold, in bytes, below which items will be
-     *                      retained in memory and above which they will be
-     *                      stored as a file.
-     * @param repository    The data repository, which is the directory in
-     *                      which files will be created, should the item size
-     *                      exceed the threshold.
-     *
+     * @param sizeThreshold The threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file.
+     * @param repository    The data repository, which is the directory in which files will be created, should the item size exceed the threshold. If
+     *                      {@code null}, the system default temporary directory in the system property {@code java.io.tmpdir} is used.
      * @deprecated 1.1 Use {@code DiskFileItemFactory} instead.
      */
     @Deprecated
diff --git a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
index a11ca2e3..a59d3cd6 100644
--- a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
@@ -165,13 +165,12 @@ public class DiskFileItem implements FileItem {
      * @param contentType   The content type passed by the browser or {@code null} if not specified.
      * @param isFormField   Whether or not this item is a plain form field, as opposed to a file upload.
      * @param fileName      The original file name in the user's file system, or {@code null} if not specified.
-     * @param sizeThreshold The threshold, in bytes, below which items will be retained in memory and above which they
-     *                      will be stored as a file.
-     * @param repository    The data repository, which is the directory in which files will be created, should the item
-     *                      size exceed the threshold.
+     * @param sizeThreshold The threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file.
+     * @param repository    The data repository, which is the directory in which files will be created, should the item size exceed the threshold. If
+     *                      {@code null}, the system default temporary directory in the system property {@code java.io.tmpdir} is used.
      */
-    public DiskFileItem(final String fieldName, final String contentType, final boolean isFormField,
-            final String fileName, final int sizeThreshold, final File repository) {
+    public DiskFileItem(final String fieldName, final String contentType, final boolean isFormField, final String fileName, final int sizeThreshold,
+            final File repository) {
         this.fieldName = fieldName;
         this.contentType = contentType;
         this.formField = isFormField;
diff --git a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItemFactory.java b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItemFactory.java
index bdaf21cd..e65eb726 100644
--- a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItemFactory.java
+++ b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItemFactory.java
@@ -86,17 +86,23 @@ public class DiskFileItemFactory implements FileItemFactory {
     private String defaultCharset = DiskFileItem.DEFAULT_CHARSET;
 
     /**
-     * Constructs an unconfigured instance of this class. The resulting factory may be configured by calling the appropriate setter methods.
+     * Constructs a new instance.
+     * <p>
+     * The resulting factory may be configured by calling the appropriate setter methods. The default data repository, which is the directory in which files
+     * will be created, should the item size exceed the threshold is set from the system default temporary directory in the system property
+     * {@code java.io.tmpdir} is used.
+     * </p>
      */
     public DiskFileItemFactory() {
         this(DEFAULT_SIZE_THRESHOLD, null);
     }
 
     /**
-     * Constructs a preconfigured instance of this class.
+     * Constructs a new instance.
      *
      * @param sizeThreshold The threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file.
-     * @param repository    The data repository, which is the directory in which files will be created, should the item size exceed the threshold.
+     * @param repository    The data repository, which is the directory in which files will be created, should the item size exceed the threshold. If
+     *                      {@code null}, the system default temporary directory in the system property {@code java.io.tmpdir} is used.
      */
     public DiskFileItemFactory(final int sizeThreshold, final File repository) {
         this.sizeThreshold = sizeThreshold;