[Git][java-team/libcommons-fileupload-java][upstream] New upstream version 1.5

Tony Mancill (@tmancill) gitlab at salsa.debian.org
Tue Feb 27 05:28:01 GMT 2024



Tony Mancill pushed to branch upstream at Debian Java Maintainers / libcommons-fileupload-java


Commits:
1a706f08 by tony mancill at 2024-02-26T20:30:18-08:00
New upstream version 1.5
- - - - -


27 changed files:

- + .gitignore
- CONTRIBUTING.md
- NOTICE.txt
- README.md
- RELEASE-NOTES.txt
- pom.xml
- + pom.xml.releaseBackup
- + release.properties
- src/changes/changes.xml
- src/changes/release-notes.vm
- src/checkstyle/checkstyle-suppressions.xml
- src/checkstyle/fileupload_basic.xml
- src/checkstyle/fileupload_checks.xml
- + src/main/java/org/apache/commons/fileupload/FileCountLimitExceededException.java
- src/main/java/org/apache/commons/fileupload/FileItemStream.java
- src/main/java/org/apache/commons/fileupload/FileUploadBase.java
- src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
- src/main/java/org/apache/commons/fileupload/util/Streams.java
- src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java
- src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java
- − src/site/resources/profile.cobertura
- .travis.yml → src/site/resources/profile.jacoco
- src/site/xdoc/download_fileupload.xml
- src/site/xdoc/issue-tracking.xml
- src/site/xdoc/mail-lists.xml
- src/test/java/org/apache/commons/fileupload/DiskFileUploadTest.java
- src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java


Changes:

=====================================
.gitignore
=====================================
@@ -0,0 +1,5 @@
+/target/
+/.settings/
+/.classpath
+/.project
+site-content/
\ No newline at end of file


=====================================
CONTRIBUTING.md
=====================================
@@ -25,7 +25,7 @@
  | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
  +======================================================================+
  |                                                                      |
- | 1) Re-generate using: mvn commons:contributing-md                    |
+ | 1) Re-generate using: mvn commons-build:contributing-md              |
  |                                                                      |
  | 2) Set the following properties in the component's pom:              |
  |    - commons.jira.id  (required, alphabetic, upper case)             |
@@ -50,48 +50,66 @@ Getting Started
 
 + Make sure you have a [JIRA account](https://issues.apache.org/jira/).
 + Make sure you have a [GitHub account](https://github.com/signup/free).
-+ If you're planning to implement a new feature it makes sense to discuss you're changes on the [dev list](https://commons.apache.org/mail-lists.html) first. This way you can make sure you're not wasting your time on something that isn't considered to be in Apache Commons FileUpload's scope.
-+ Submit a ticket for your issue, assuming one does not already exist.
++ If you're planning to implement a new feature it makes sense to discuss your changes on the [dev list](https://commons.apache.org/mail-lists.html) first. This way you can make sure you're not wasting your time on something that isn't considered to be in Apache Commons FileUpload's scope.
++ Submit a [Jira Ticket][jira] for your issue, assuming one does not already exist.
   + Clearly describe the issue including steps to reproduce when it is a bug.
   + Make sure you fill in the earliest version that you know has the issue.
-+ Fork the repository on GitHub.
++ Find the corresponding [repository on GitHub](https://github.com/apache/?query=commons-),
+[fork](https://help.github.com/articles/fork-a-repo/) and check out your forked repository.
 
 Making Changes
 --------------
 
-+ Create a topic branch from where you want to base your work (this is usually the master/trunk branch).
++ Create a _topic branch_ for your isolated work.
+  * Usually you should base your branch on the `master` or `trunk` branch.
+  * A good topic branch name can be the JIRA bug id plus a keyword, e.g. `FILEUPLOAD-123-InputStream`.
+  * If you have submitted multiple JIRA issues, try to maintain separate branches and pull requests.
 + Make commits of logical units.
+  * Make sure your commit messages are meaningful and in the proper format. Your commit message should contain the key of the JIRA issue.
+  * e.g. `FILEUPLOAD-123: Close input stream earlier`
 + Respect the original code style:
   + Only use spaces for indentation.
-  + Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change.
-  + Check for unnecessary whitespace with git diff --check before committing.
-+ Make sure your commit messages are in the proper format. Your commit message should contain the key of the JIRA issue.
-+ Make sure you have added the necessary tests for your changes.
+  + Create minimal diffs - disable _On Save_ actions like _Reformat Source Code_ or _Organize Imports_. If you feel the source code should be reformatted create a separate PR for this change first.
+  + Check for unnecessary whitespace with `git diff` -- check before committing.
++ Make sure you have added the necessary tests for your changes, typically in `src/test/java`.
 + Run all the tests with `mvn clean verify` to assure nothing else was accidentally broken.
 
 Making Trivial Changes
 ----------------------
 
+The JIRA tickets are used to generate the changelog for the next release.
+
 For changes of a trivial nature to comments and documentation, it is not always necessary to create a new ticket in JIRA.
 In this case, it is appropriate to start the first line of a commit with '(doc)' instead of a ticket number.
 
+
 Submitting Changes
 ------------------
 
-+ Sign the [Contributor License Agreement][cla] if you haven't already.
++ Sign and submit the Apache [Contributor License Agreement][cla] if you haven't already.
+  * Note that small patches & typical bug fixes do not require a CLA as
+    clause 5 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0.html#contributions)
+    covers them.
 + Push your changes to a topic branch in your fork of the repository.
-+ Submit a pull request to the repository in the apache organization.
++ Submit a _Pull Request_ to the corresponding repository in the `apache` organization.
+  * Verify _Files Changed_ shows only your intended changes and does not
+  include additional files like `target/*.class`
 + Update your JIRA ticket and include a link to the pull request in the ticket.
 
+If you prefer to not use GitHub, then you can instead use
+`git format-patch` (or `svn diff`) and attach the patch file to the JIRA issue.
+
+
 Additional Resources
 --------------------
 
 + [Contributing patches](https://commons.apache.org/patches.html)
-+ [Apache Commons FileUpload JIRA project page](https://issues.apache.org/jira/browse/FILEUPLOAD)
++ [Apache Commons FileUpload JIRA project page][jira]
 + [Contributor License Agreement][cla]
 + [General GitHub documentation](https://help.github.com/)
-+ [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
++ [GitHub pull request documentation](https://help.github.com/articles/creating-a-pull-request/)
 + [Apache Commons Twitter Account](https://twitter.com/ApacheCommons)
-+ #apachecommons IRC channel on freenode.org
++ `#apache-commons` IRC channel on `irc.freenode.net`
 
 [cla]:https://www.apache.org/licenses/#clas
+[jira]:https://issues.apache.org/jira/browse/FILEUPLOAD


=====================================
NOTICE.txt
=====================================
@@ -1,5 +1,5 @@
 Apache Commons FileUpload
-Copyright 2002-2018 The Apache Software Foundation
+Copyright 2002-2023 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).


=====================================
README.md
=====================================
@@ -25,7 +25,7 @@
  | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
  +======================================================================+
  |                                                                      |
- | 1) Re-generate using: mvn commons:readme-md                          |
+ | 1) Re-generate using: mvn commons-build:readme-md                    |
  |                                                                      |
  | 2) Set the following properties in the component's pom:              |
  |    - commons.componentid (required, alphabetic, lower case)          |
@@ -43,8 +43,11 @@
 Apache Commons FileUpload
 ===================
 
-[![Build Status](https://travis-ci.org/apache/commons-fileupload.svg?branch=master)](https://travis-ci.org/apache/commons-fileupload)
+[![Travis-CI Status](https://travis-ci.org/apache/commons-fileupload.svg)](https://travis-ci.org/apache/commons-fileupload)
+[![GitHub Actions Status](https://github.com/apache/commons-fileupload/workflows/Java%20CI/badge.svg)](https://github.com/apache/commons-fileupload/actions)
+[![Coverage Status](https://coveralls.io/repos/apache/commons-fileupload/badge.svg)](https://coveralls.io/r/apache/commons-fileupload)
 [![Maven Central](https://maven-badges.herokuapp.com/maven-central/commons-fileupload/commons-fileupload/badge.svg)](https://maven-badges.herokuapp.com/maven-central/commons-fileupload/commons-fileupload/)
+[![Javadocs](https://javadoc.io/badge/commons-fileupload/commons-fileupload/1.5.svg)](https://javadoc.io/doc/commons-fileupload/commons-fileupload/1.5)
 
 The Apache Commons FileUpload component provides a simple yet flexible means of adding support for multipart
     file upload functionality to servlets and web applications.
@@ -53,7 +56,7 @@ Documentation
 -------------
 
 More information can be found on the [Apache Commons FileUpload homepage](https://commons.apache.org/proper/commons-fileupload).
-The [Javadoc](https://commons.apache.org/proper/commons-fileupload/javadocs/api-release) can be browsed.
+The [Javadoc](https://commons.apache.org/proper/commons-fileupload/apidocs) can be browsed.
 Questions related to the usage of Apache Commons FileUpload should be posted to the [user mailing list][ml].
 
 Where can I get the latest release?
@@ -66,7 +69,7 @@ Alternatively you can pull it from the central Maven repositories:
 <dependency>
   <groupId>commons-fileupload</groupId>
   <artifactId>commons-fileupload</artifactId>
-  <version>1.4</version>
+  <version>1.5</version>
 </dependency>
 ```
 


=====================================
RELEASE-NOTES.txt
=====================================
@@ -1,3 +1,35 @@
+              Apache Commons FileUpload 1.5 RELEASE NOTES
+
+The Apache Commons FileUpload team is pleased to announce the release of Apache Commons FileUpload 1.5.
+
+The Apache Commons FileUpload component provides a simple yet flexible means of
+adding support for multipart file upload functionality to servlets and web
+applications. Version 1.3 onwards requires Java 6 or later.
+
+No client code changes are required to migrate from version 1.4 to 1.5.
+
+Changes in version 1.5 include:
+
+New features:
+o                  Add a configurable limit (disabled by default) for the number of files to upload per request. 
+
+Fixed Bugs:
+o FILEUPLOAD-293:  DiskFileItem.write(File) had been changed to use FileUtils.moveFile internally, preventing an existing file as the target. 
+o                  Improve parsing speed. Thanks to David Georg Reichelt.
+
+Changes:
+o                  Bump Commons IO to 2.11.0 
+o FILEUPLOAD-328   Switch from Cobertura code coverage to Jacoco code coverage. Thanks to Arturo Bernal. 
+o                  Bump JUnit to 4.13.2 
+
+
+For complete information on Apache Commons FileUpload, including instructions on how to submit bug reports,
+patches, or suggestions for improvement, see the Apache Apache Commons FileUpload website:
+
+https://commons.apache.org/proper/commons-fileupload/
+
+------------------------------------------------------------------------------
+
               Apache Commons FileUpload 1.4 RELEASE NOTES
 
 The Apache Commons FileUpload team is pleased to announce the release of Apache Commons FileUpload 1.4.
@@ -33,7 +65,7 @@ Changes:
 o FILEUPLOAD-292:  Don't create un-needed resources in FileUploadBase.java
 o FILEUPLOAD-282:  Upversion complier.source, compiler.target to 1.6
 o FILEUPLOAD-246:  FileUpload should use IOUtils.closeQuietly where relevant
-o FILEUPLOAD-243:  Make some MultipartStream private fields final Thanks to Ville Skyttä.
+o FILEUPLOAD-243:  Make some MultipartStream private fields final Thanks to Ville Skytt�.
 
 
 For complete information on Apache Commons FileUpload, including instructions on how to submit bug reports,


=====================================
pom.xml
=====================================
@@ -21,19 +21,19 @@
   <parent>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-parent</artifactId>
-    <version>47</version>
+    <version>56</version>
   </parent>
 
   <groupId>commons-fileupload</groupId>
   <artifactId>commons-fileupload</artifactId>
-  <version>1.4</version>
+  <version>1.5</version>
 
   <name>Apache Commons FileUpload</name>
   <description>
     The Apache Commons FileUpload component provides a simple yet flexible means of adding support for multipart
     file upload functionality to servlets and web applications.
   </description>
-  <url>http://commons.apache.org/proper/commons-fileupload/</url>
+  <url>https://commons.apache.org/proper/commons-fileupload/</url>
   <inceptionYear>2002</inceptionYear>
 
   <developers>
@@ -180,13 +180,14 @@
   </contributors>
 
   <scm>
-    <connection>scm:git:http://git-wip-us.apache.org/repos/asf/commons-fileupload.git</connection>
-    <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/commons-fileupload.git</developerConnection>
-    <url>https://git-wip-us.apache.org/repos/asf?p=commons-fileupload.git</url>
+    <connection>scm:git:http://gitbox.apache.org/repos/asf/commons-fileupload.git</connection>
+    <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/commons-fileupload.git</developerConnection>
+    <url>https://gitbox.apache.org/repos/asf?p=commons-fileupload.git</url>
+    <tag>commons-fileupload-1.5-RC1</tag>
   </scm>
   <issueManagement>
     <system>jira</system>
-    <url>http://issues.apache.org/jira/browse/FILEUPLOAD</url>
+    <url>https://issues.apache.org/jira/browse/FILEUPLOAD</url>
   </issueManagement>
 
   <distributionManagement>
@@ -202,6 +203,7 @@
     <maven.compiler.target>1.6</maven.compiler.target>
     <commons.componentid>fileupload</commons.componentid>
     <commons.module.name>org.apache.commons.fileupload</commons.module.name>
+    <commons.release.version>1.5</commons.release.version>
     <commons.release.desc>(requires Java ${maven.compiler.target} or later)</commons.release.desc>
     <commons.jira.id>FILEUPLOAD</commons.jira.id>
     <commons.jira.pid>12310476</commons.jira.pid>
@@ -211,13 +213,11 @@
     <commons.osgi.export>!org.apache.commons.fileupload.util.mime,org.apache.commons.*;version=${project.version};-noimport:=true</commons.osgi.export>
     <commons.osgi.import>!javax.portlet,*</commons.osgi.import>
     <commons.osgi.dynamicImport>javax.portlet</commons.osgi.dynamicImport>
-    <commons.japicmp.version>0.13.0</commons.japicmp.version>
-    <japicmp.skip>true</japicmp.skip>
+    <japicmp.skip>false</japicmp.skip>
 
     <!-- Commons Release Plugin -->
-    <commons.release.version>1.4</commons.release.version>
-    <commons.bc.version>1.3.3</commons.bc.version>
-    <commons.rc.version>RC2</commons.rc.version>
+    <commons.bc.version>1.4</commons.bc.version>
+    <commons.rc.version>RC1</commons.rc.version>
     <commons.release.isDistModule>true</commons.release.isDistModule>
     <commons.distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid}</commons.distSvnStagingUrl>
     <commons.releaseManagerName>Rob Tompkins</commons.releaseManagerName>
@@ -228,7 +228,7 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>4.12</version>
+      <version>4.13.2</version>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -246,12 +246,34 @@
     <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
-      <version>2.2</version>
+      <version>2.11.0</version>
     </dependency>
   </dependencies>
 
   <build>
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>validate-main</id>
+            <phase>validate</phase>
+            <configuration>
+              <configLocation>${basedir}/src/checkstyle/fileupload_checks.xml</configLocation>
+              <suppressionsLocation>${basedir}/src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
+              <includeTestSourceDirectory>false</includeTestSourceDirectory>
+              <enableRulesSummary>false</enableRulesSummary>
+              <consoleOutput>true</consoleOutput>
+              <failsOnError>true</failsOnError>
+              <linkXRef>false</linkXRef>
+            </configuration>
+            <goals>
+              <goal>checkstyle</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <artifactId>maven-assembly-plugin</artifactId>
         <configuration>
@@ -262,13 +284,6 @@
           <tarLongFileMode>gnu</tarLongFileMode>
         </configuration>
       </plugin>
-      <plugin>
-        <artifactId>maven-release-plugin</artifactId>
-        <configuration>
-          <preparationGoals>clean site verify</preparationGoals>
-          <goals>clean site deploy</goals>
-        </configuration>
-      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>
@@ -282,13 +297,10 @@
               <exclude>src/checkstyle/license-header.txt</exclude>
             </excludes>
           </configuration>
-        </plugin><!-- override skip property of parent pom -->
+        </plugin>
         <plugin>
           <groupId>com.github.siom79.japicmp</groupId>
           <artifactId>japicmp-maven-plugin</artifactId>
-          <configuration>
-            <skip>true</skip>
-          </configuration>
         </plugin>
         <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
         <plugin>
@@ -308,7 +320,7 @@
                     </goals>
                   </pluginExecutionFilter>
                   <action>
-                    <execute/>
+                    <execute />
                   </action>
                 </pluginExecution>
                 <pluginExecution>
@@ -321,13 +333,23 @@
                     </goals>
                   </pluginExecutionFilter>
                   <action>
-                    <execute/>
+                    <execute />
                   </action>
                 </pluginExecution>
               </pluginExecutions>
             </lifecycleMappingMetadata>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-checkstyle-plugin</artifactId>
+          <configuration>
+            <configLocation>${basedir}/src/checkstyle/fileupload_checks.xml</configLocation>
+            <suppressionsLocation>${basedir}/src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
+            <includeTestSourceDirectory>false</includeTestSourceDirectory>
+            <enableRulesSummary>false</enableRulesSummary>
+          </configuration>
+        </plugin>
       </plugins>
     </pluginManagement>
   </build>
@@ -353,18 +375,20 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
-        <version>2.10</version>
         <configuration>
           <configLocation>${basedir}/src/checkstyle/fileupload_checks.xml</configLocation>
           <suppressionsLocation>${basedir}/src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
+          <includeTestSourceDirectory>false</includeTestSourceDirectory>
           <enableRulesSummary>false</enableRulesSummary>
-          <headerLocation>${basedir}/src/checkstyle/license-header.txt</headerLocation>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>com.github.siom79.japicmp</groupId>
+        <artifactId>japicmp-maven-plugin</artifactId>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-pmd-plugin</artifactId>
-        <version>2.7.1</version>
         <configuration>
           <targetJdk>${maven.compiler.target}</targetJdk>
           <rulesets>
@@ -372,20 +396,6 @@
           </rulesets>
         </configuration>
       </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>clirr-maven-plugin</artifactId>
-        <version>${commons.clirr.version}</version>
-        <configuration>
-          <comparisonArtifacts>
-            <comparisonArtifact>
-              <groupId>commons-fileupload</groupId>
-              <artifactId>commons-fileupload</artifactId>
-              <version>1.3</version>
-            </comparisonArtifact>
-          </comparisonArtifacts>
-        </configuration>
-      </plugin>
     </plugins>
   </reporting>
 
@@ -410,22 +420,22 @@
                   <goal>run</goal>
                 </goals>
                 <configuration>
-                  <tasks>
+                  <target>
                     <exec executable="svn">
-                      <arg line="checkout --depth immediates ${commons.scmPubUrl} ${commons.scmPubCheckoutDirectory}"/>
+                      <arg line="checkout --depth immediates ${commons.scmPubUrl} ${commons.scmPubCheckoutDirectory}" />
                     </exec>
 
                     <exec executable="svn">
-                      <arg line="update --set-depth exclude ${commons.scmPubCheckoutDirectory}/javadocs"/>
+                      <arg line="update --set-depth exclude ${commons.scmPubCheckoutDirectory}/javadocs" />
                     </exec>
 
                     <pathconvert pathsep=" " property="dirs">
-                      <dirset dir="${commons.scmPubCheckoutDirectory}" includes="*"/>
+                      <dirset dir="${commons.scmPubCheckoutDirectory}" includes="*" />
                     </pathconvert>
                     <exec executable="svn">
-                      <arg line="update --set-depth infinity ${dirs}"/>
+                      <arg line="update --set-depth infinity ${dirs}" />
                     </exec>
-                  </tasks>
+                  </target>
                 </configuration>
               </execution>
             </executions>


=====================================
pom.xml.releaseBackup
=====================================
@@ -0,0 +1,456 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.commons</groupId>
+    <artifactId>commons-parent</artifactId>
+    <version>56</version>
+  </parent>
+
+  <groupId>commons-fileupload</groupId>
+  <artifactId>commons-fileupload</artifactId>
+  <version>1.5-SNAPSHOT</version>
+
+  <name>Apache Commons FileUpload</name>
+  <description>
+    The Apache Commons FileUpload component provides a simple yet flexible means of adding support for multipart
+    file upload functionality to servlets and web applications.
+  </description>
+  <url>https://commons.apache.org/proper/commons-fileupload/</url>
+  <inceptionYear>2002</inceptionYear>
+
+  <developers>
+    <developer>
+      <name>Martin Cooper</name>
+      <id>martinc</id>
+      <email>martinc at apache.org</email>
+      <organization>Yahoo!</organization>
+    </developer>
+    <developer>
+      <name>dIon Gillard</name>
+      <id>dion</id>
+      <email>dion at apache.org</email>
+      <organization>Multitask Consulting</organization>
+    </developer>
+    <developer>
+      <name>John McNally</name>
+      <id>jmcnally</id>
+      <email>jmcnally at collab.net</email>
+      <organization>CollabNet</organization>
+    </developer>
+    <developer>
+      <name>Daniel Rall</name>
+      <id>dlr</id>
+      <email>dlr at finemaltcoding.com</email>
+      <organization>CollabNet</organization>
+    </developer>
+    <developer>
+      <name>Jason van Zyl</name>
+      <id>jvanzyl</id>
+      <email>jason at zenplex.com</email>
+      <organization>Zenplex</organization>
+    </developer>
+    <developer>
+      <name>Robert Burrell Donkin</name>
+      <id>rdonkin</id>
+      <email>rdonkin at apache.org</email>
+      <organization />
+    </developer>
+    <developer>
+      <name>Sean C. Sullivan</name>
+      <id>sullis</id>
+      <email>sean |at| seansullivan |dot| com</email>
+      <organization />
+    </developer>
+    <developer>
+      <name>Jochen Wiedmann</name>
+      <id>jochen</id>
+      <email>jochen.wiedmann at gmail.com</email>
+      <organization />
+    </developer>
+    <developer>
+      <name>Simone Tripodi</name>
+      <id>simonetripodi</id>
+      <email>simonetripodi at apache.org</email>
+      <organization>Adobe</organization>
+    </developer>
+    <developer>
+      <name>Gary Gregory</name>
+      <id>ggregory</id>
+      <email>ggregory at apache.org</email>
+      <organization />
+    </developer>
+    <developer>
+      <name>Rob Tompkins</name>
+      <id>chtompki</id>
+      <email>chtompki at apache.org</email>
+    </developer>
+  </developers>
+
+  <contributors>
+    <contributor>
+      <name>Aaron Freeman</name>
+      <email>aaron at sendthisfile.com</email>
+    </contributor>
+    <contributor>
+      <name>Daniel Fabian</name>
+      <email>dfabian at google.com</email>
+    </contributor>
+    <contributor>
+      <name>Jörg Heinicke</name>
+      <email>joerg.heinicke at gmx.de</email>
+    </contributor>
+    <contributor>
+      <name>Stepan Koltsov</name>
+      <email>yozh at mx1.ru</email>
+    </contributor>
+    <contributor>
+      <name>Michael Macaluso</name>
+      <email>michael.public at wavecorp.com</email>
+    </contributor>
+    <contributor>
+      <name>Amichai Rothman</name>
+      <email>amichai2 at amichais.net</email>
+    </contributor>
+    <contributor>
+      <name>Alexander Sova</name>
+      <email>bird at noir.crocodile.org</email>
+    </contributor>
+    <contributor>
+      <name>Paul Spurr</name>
+      <email>pspurr at gmail.com</email>
+    </contributor>
+    <contributor>
+      <name>Thomas Vandahl</name>
+      <email>tv at apache.org</email>
+    </contributor>
+    <contributor>
+      <name>Henry Yandell</name>
+      <email>bayard at apache.org</email>
+    </contributor>
+    <contributor>
+      <name>Jan Novotný</name>
+      <email>novotnaci at gmail.com</email>
+    </contributor>
+    <contributor>
+      <name>frank</name>
+      <email>mailsurfie at gmail.com</email>
+    </contributor>
+    <contributor>
+      <name>maxxedev</name>
+      <email>maxxedev at gmail.com</email>
+    </contributor>
+    <contributor>
+      <name>Rafal Krzewski</name>
+      <email>Rafal.Krzewski at e-point.pl</email>
+    </contributor>
+    <contributor>
+      <name>Sean Legassick</name>
+      <email>sean at informage.net</email>
+    </contributor>
+    <contributor>
+      <name>Oleg Kalnichevski</name>
+      <email>oleg at ural.ru</email>
+    </contributor>
+    <contributor>
+      <name>David Sean Taylor</name>
+      <email>taylor at apache.org</email>
+    </contributor>
+    <contributor>
+      <name>fangwentong</name>
+      <email>fangwentong2012 at gmail.com</email>
+    </contributor>
+  </contributors>
+
+  <scm>
+    <connection>scm:git:http://gitbox.apache.org/repos/asf/commons-fileupload.git</connection>
+    <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/commons-fileupload.git</developerConnection>
+    <url>https://gitbox.apache.org/repos/asf?p=commons-fileupload.git</url>
+  </scm>
+  <issueManagement>
+    <system>jira</system>
+    <url>https://issues.apache.org/jira/browse/FILEUPLOAD</url>
+  </issueManagement>
+
+  <distributionManagement>
+    <site>
+      <id>apache.website</id>
+      <name>Apache Commons Site</name>
+      <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-fileupload/</url>
+    </site>
+  </distributionManagement>
+
+  <properties>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
+    <commons.componentid>fileupload</commons.componentid>
+    <commons.module.name>org.apache.commons.fileupload</commons.module.name>
+    <commons.release.version>1.5</commons.release.version>
+    <commons.release.desc>(requires Java ${maven.compiler.target} or later)</commons.release.desc>
+    <commons.jira.id>FILEUPLOAD</commons.jira.id>
+    <commons.jira.pid>12310476</commons.jira.pid>
+    <commons.site.path>fileupload</commons.site.path>
+    <commons.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-fileupload</commons.scmPubUrl>
+    <commons.scmPubCheckoutDirectory>site-content</commons.scmPubCheckoutDirectory>
+    <commons.osgi.export>!org.apache.commons.fileupload.util.mime,org.apache.commons.*;version=${project.version};-noimport:=true</commons.osgi.export>
+    <commons.osgi.import>!javax.portlet,*</commons.osgi.import>
+    <commons.osgi.dynamicImport>javax.portlet</commons.osgi.dynamicImport>
+    <japicmp.skip>false</japicmp.skip>
+
+    <!-- Commons Release Plugin -->
+    <commons.bc.version>1.4</commons.bc.version>
+    <commons.rc.version>RC1</commons.rc.version>
+    <commons.release.isDistModule>true</commons.release.isDistModule>
+    <commons.distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid}</commons.distSvnStagingUrl>
+    <commons.releaseManagerName>Rob Tompkins</commons.releaseManagerName>
+    <commons.releaseManagerKey>B6E73D84EA4FCC47166087253FAAD2CD5ECBB314</commons.releaseManagerKey>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.13.2</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>portlet-api</groupId>
+      <artifactId>portlet-api</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>2.11.0</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>validate-main</id>
+            <phase>validate</phase>
+            <configuration>
+              <configLocation>${basedir}/src/checkstyle/fileupload_checks.xml</configLocation>
+              <suppressionsLocation>${basedir}/src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
+              <includeTestSourceDirectory>false</includeTestSourceDirectory>
+              <enableRulesSummary>false</enableRulesSummary>
+              <consoleOutput>true</consoleOutput>
+              <failsOnError>true</failsOnError>
+              <linkXRef>false</linkXRef>
+            </configuration>
+            <goals>
+              <goal>checkstyle</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptors>
+            <descriptor>${basedir}/src/main/assembly/bin.xml</descriptor>
+            <descriptor>${basedir}/src/main/assembly/src.xml</descriptor>
+          </descriptors>
+          <tarLongFileMode>gnu</tarLongFileMode>
+        </configuration>
+      </plugin>
+    </plugins>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.rat</groupId>
+          <artifactId>apache-rat-plugin</artifactId>
+          <configuration>
+            <excludes>
+              <exclude>site-content/**</exclude>
+              <exclude>src/site/resources/download_lang.cgi</exclude>
+              <exclude>src/checkstyle/license-header.txt</exclude>
+            </excludes>
+          </configuration>
+        </plugin>
+        <plugin>
+          <groupId>com.github.siom79.japicmp</groupId>
+          <artifactId>japicmp-maven-plugin</artifactId>
+        </plugin>
+        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+        <plugin>
+          <groupId>org.eclipse.m2e</groupId>
+          <artifactId>lifecycle-mapping</artifactId>
+          <version>1.0.0</version>
+          <configuration>
+            <lifecycleMappingMetadata>
+              <pluginExecutions>
+                <pluginExecution>
+                  <pluginExecutionFilter>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-antrun-plugin</artifactId>
+                    <versionRange>[1.8,)</versionRange>
+                    <goals>
+                      <goal>run</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <execute />
+                  </action>
+                </pluginExecution>
+                <pluginExecution>
+                  <pluginExecutionFilter>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>build-helper-maven-plugin</artifactId>
+                    <versionRange>[1.10,)</versionRange>
+                    <goals>
+                      <goal>parse-version</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <execute />
+                  </action>
+                </pluginExecution>
+              </pluginExecutions>
+            </lifecycleMappingMetadata>
+          </configuration>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-checkstyle-plugin</artifactId>
+          <configuration>
+            <configLocation>${basedir}/src/checkstyle/fileupload_checks.xml</configLocation>
+            <suppressionsLocation>${basedir}/src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
+            <includeTestSourceDirectory>false</includeTestSourceDirectory>
+            <enableRulesSummary>false</enableRulesSummary>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-changes-plugin</artifactId>
+        <version>${commons.changes.version}</version>
+        <configuration>
+          <issueLinkTemplate>%URL%/../%ISSUE%</issueLinkTemplate>
+        </configuration>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>changes-report</report>
+              <!--  NPE, retry from time to time <report>jira-report</report>  -->
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <configLocation>${basedir}/src/checkstyle/fileupload_checks.xml</configLocation>
+          <suppressionsLocation>${basedir}/src/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
+          <includeTestSourceDirectory>false</includeTestSourceDirectory>
+          <enableRulesSummary>false</enableRulesSummary>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>com.github.siom79.japicmp</groupId>
+        <artifactId>japicmp-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <configuration>
+          <targetJdk>${maven.compiler.target}</targetJdk>
+          <rulesets>
+            <ruleset>${basedir}/src/checkstyle/fileupload_basic.xml</ruleset>
+          </rulesets>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
+
+  <profiles>
+    <profile>
+      <id>setup-checkout</id>
+      <activation>
+        <file>
+          <missing>site-content</missing>
+        </file>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>prepare-checkout</id>
+                <phase>pre-site</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <target>
+                    <exec executable="svn">
+                      <arg line="checkout --depth immediates ${commons.scmPubUrl} ${commons.scmPubCheckoutDirectory}" />
+                    </exec>
+
+                    <exec executable="svn">
+                      <arg line="update --set-depth exclude ${commons.scmPubCheckoutDirectory}/javadocs" />
+                    </exec>
+
+                    <pathconvert pathsep=" " property="dirs">
+                      <dirset dir="${commons.scmPubCheckoutDirectory}" includes="*" />
+                    </pathconvert>
+                    <exec executable="svn">
+                      <arg line="update --set-depth infinity ${dirs}" />
+                    </exec>
+                  </target>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>java9</id>
+      <activation>
+        <jdk>9</jdk>
+      </activation>
+      <properties>
+        <!-- coverall version 4.3.0 does not work with java 9, see https://github.com/trautonen/coveralls-maven-plugin/issues/112 -->
+        <coveralls.skip>true</coveralls.skip>
+      </properties>
+    </profile>
+  </profiles>
+</project>


=====================================
release.properties
=====================================
@@ -0,0 +1,25 @@
+#release configuration
+#Wed Feb 01 12:30:53 GMT 2023
+scm.commentPrefix=[maven-release-plugin] 
+exec.pomFileName=pom.xml
+project.dev.commons-fileupload\:commons-fileupload=1.5-SNAPSHOT
+pushChanges=true
+releaseStrategyId=default
+scm.tag=commons-fileupload-1.5-RC1
+remoteTagging=true
+scm.branchCommitComment=@{prefix} prepare branch @{releaseLabel}
+project.scm.commons-fileupload\:commons-fileupload.developerConnection=scm\:git\:https\://gitbox.apache.org/repos/asf/commons-fileupload.git
+projectVersionPolicyId=default
+scm.url=scm\:git\:https\://gitbox.apache.org/repos/asf/commons-fileupload.git
+scm.tagNameFormat=@{project.artifactId}-@{project.version}
+project.rel.commons-fileupload\:commons-fileupload=1.5
+pinExternals=false
+preparationGoals=clean verify
+scm.releaseCommitComment=@{prefix} prepare release @{releaseLabel}
+project.scm.commons-fileupload\:commons-fileupload.connection=scm\:git\:http\://gitbox.apache.org/repos/asf/commons-fileupload.git
+project.scm.commons-fileupload\:commons-fileupload.tag=HEAD
+exec.snapshotReleasePluginAllowed=false
+scm.developmentCommitComment=@{prefix} prepare for next development iteration
+scm.rollbackCommitComment=@{prefix} rollback the release of @{releaseLabel}
+completedPhase=end-release
+project.scm.commons-fileupload\:commons-fileupload.url=https\://gitbox.apache.org/repos/asf?p\=commons-fileupload.git


=====================================
src/changes/changes.xml
=====================================
@@ -23,7 +23,7 @@ Useful ways of finding items to add to this file are:
 1.  Add items when you fix a bug or add a feature (this makes the 
 release process easy :-).
 
-2.  Do a bugzilla search for tickets closed since the previous release.
+2.  Do a Jira search for tickets closed since the previous release.
 
 3.  Use the report generated by the maven-changelog-plugin to see all
 CVS commits.  Set the project.properties' maven.changelog.range 
@@ -38,11 +38,19 @@ The <action> type attribute can be add,update,fix,remove.
     xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
 
   <properties>
-    <title>Release Notes</title>
+    <title>Apache Commons FileUpload Release Notes</title>
     <author email="dev at commons.apache.org">Apache Commons Developers</author>
   </properties>
 
   <body>
+    <release version="1.5" date="TBD" description="1.5 Release">
+      <action                        dev="markt" type="update">Bump Commons IO to 2.11.0</action>
+      <action issue="FILEUPLOAD-293" dev="jochen" type="fix">DiskFileItem.write(File) had been changed to use FileUtils.moveFile internally, preventing an existing file as the target</action>
+      <action                        dev="markt" due-to="David Georg Reichelt" type="fix">Improve parsing speed</action>
+      <action issue="FILEUPLOAD-328" dev="markt" due-to="Arturo Bernal" type="update">Switch from Cobertura code coverage to Jacoco code coverage</action>
+      <action                        dev="markt" type="add">Add a configurable limit (disabled by default) for the number of files to upload per request</action>
+      <action                        dev="markt" type="update">Bump JUnit to 4.13.2</action>
+    </release>
     <release version="1.4" date="2018-12-23" description="1.4 Release">
       <action issue="FILEUPLOAD-292" dev="chtompki" type="update">Don't create un-needed resources in FileUploadBase.java</action>
       <action issue="FILEUPLOAD-282" dev="chtompki" type="update">Upversion complier.source, compiler.target to 1.6</action>


=====================================
src/changes/release-notes.vm
=====================================
@@ -22,7 +22,7 @@ The Apache Commons FileUpload component provides a simple yet flexible means of
 adding support for multipart file upload functionality to servlets and web
 applications. Version 1.3 onwards requires Java 6 or later.
 
-No client code changes are required to migrate from version 1.3.0 to 1.3.1.
+No client code changes are required to migrate from version 1.4 to 1.5.
 
 
 ## N.B. the available variables are described here:


=====================================
src/checkstyle/checkstyle-suppressions.xml
=====================================
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE suppressions PUBLIC
-     "-//Puppy Crawl//DTD Suppressions 1.0//EN"
-     "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
+     "-//Checkstyle//DTD SuppressionFilter Configuration 1.0//EN"
+     "https://checkstyle.org/dtds/suppressions_1_0.dtd">
 <!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with


=====================================
src/checkstyle/fileupload_basic.xml
=====================================
@@ -19,7 +19,7 @@
 <ruleset name="FileUpload Basic Rules">
   <description>PMD Basic Ruleset minus the EmptyCatchBlock rule.</description>
 
-  <rule ref="rulesets/basic.xml">
+  <rule ref="category/java/errorprone.xml">
     <exclude name="EmptyCatchBlock"/>
   </rule>
 </ruleset>


=====================================
src/checkstyle/fileupload_checks.xml
=====================================
@@ -17,8 +17,8 @@
 -->
 
 <!DOCTYPE module PUBLIC
-    "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
-    "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
+    "-//Checkstyle//DTD Checkstyle Configuration 1.2//EN"
+    "https://checkstyle.org/dtds/configuration_1_2.dtd">
 
 <!--
   Checkstyle configuration for Commons FileUpload. FileUpload uses the Sun
@@ -74,11 +74,6 @@
     <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
     <module name="Translation"/>
 
-    <!-- Following interprets the header file as regular expressions. -->
-    <!-- <module name="RegexpHeader"/>                                -->
-    <module name="RegexpHeader">
-        <property name="headerFile" value="${checkstyle.header.file}"/>
-    </module>
 
     <!-- Checks for Size Violations.                    -->
     <!-- See http://checkstyle.sf.net/config_sizes.html -->
@@ -90,28 +85,42 @@
     <!-- Require package Javadoc -->
     <module name="JavadocPackage"/>
 
-    <!-- Allow comments to suppress checks -->
-    <module name="SuppressionCommentFilter"/>
 
-    <module name="SuppressWithNearbyCommentFilter">
-        <property name="commentFormat" value="CHECKSTYLE IGNORE (\w+) FOR NEXT (\d+) LINES?"/>
-        <property name="checkFormat" value="$1"/>
-        <property name="influenceFormat" value="$2"/>
+    <property name="cacheFile" value="${checkstyle.cache.file}"/>
+
+    <!-- Begin Custom for FileUpload -->
+    <module name="LineLength">
+        <property name="max" value="120"/>
+        <property name="ignorePattern" value="^ \* @version .*$"/>
     </module>
 
     <module name="TreeWalker">
 
-        <property name="cacheFile" value="${checkstyle.cache.file}"/>
+        <!-- Not fixed in 1.x branch
+        <module name="FinalLocalVariable">
+            <property name="tokens" value="VARIABLE_DEF,PARAMETER_DEF"/>
+            <property name="validateEnhancedForLoopVariable" value="true"/>
+        </module>
+        -->
 
         <!-- Allow comments to suppress checks -->
-        <module name="FileContentsHolder"/>
+        <module name="SuppressionCommentFilter"/>
+
+        <module name="SuppressWithNearbyCommentFilter">
+          <property name="commentFormat" value="CHECKSTYLE IGNORE (\w+) FOR NEXT (\d+) LINES?"/>
+          <property name="checkFormat" value="$1"/>
+          <property name="influenceFormat" value="$2"/>
+        </module>
+
+
+
+        <!-- Allow comments to suppress checks
+        <module name="FileContentsHolder"/>-->
 
         <!-- Checks for Javadoc comments.                     -->
         <!-- See http://checkstyle.sf.net/config_javadoc.html -->
         <module name="JavadocMethod">
-          <property name="scope" value="protected"/>
-          <property name="allowUndeclaredRTE" value="true"/>
-          <property name="allowThrowsTagsForSubclasses" value="true"/>
+          <property name="accessModifiers" value="protected"/>
         </module>
         <module name="JavadocType"/>
         <module name="JavadocVariable"/>
@@ -153,11 +162,6 @@
         <module name="RedundantImport"/>
         <module name="UnusedImports"/>
 
-        <!-- Begin Custom for FileUpload -->
-        <module name="LineLength">
-          <property name="max" value="120"/>
-          <property name="ignorePattern" value="^ \* @version .*$"/>
-        </module>
         <!-- End Custom for FileUpload -->
         <module name="MethodLength"/>
         <module name="ParameterNumber"/>
@@ -197,7 +201,6 @@
 
         <!-- Checks for common coding problems               -->
         <!-- See http://checkstyle.sf.net/config_coding.html -->
-        <module name="AvoidInlineConditionals"/>
         <module name="EmptyStatement"/>
         <module name="EqualsHashCode"/>
         <!-- Disabled for FileUpload: module name="HiddenField"/ -->
@@ -205,9 +208,6 @@
         <module name="InnerAssignment"/>
         <module name="MagicNumber"/>
         <module name="MissingSwitchDefault"/>
-        <module name="RedundantThrows">
-          <property name="allowSubclasses" value="true"/>
-        </module>
         <module name="SimplifyBooleanExpression"/>
         <module name="SimplifyBooleanReturn"/>
 


=====================================
src/main/java/org/apache/commons/fileupload/FileCountLimitExceededException.java
=====================================
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.fileupload;
+
+/**
+ * This exception is thrown if a request contains more files than the specified
+ * limit.
+ */
+public class FileCountLimitExceededException extends FileUploadException {
+
+    private static final long serialVersionUID = 6904179610227521789L;
+
+    /**
+     * The limit that was exceeded.
+     */
+    private final long limit;
+
+    /**
+     * Creates a new instance.
+     *
+     * @param message The detail message
+     * @param limit The limit that was exceeded
+     */
+    public FileCountLimitExceededException(final String message, final long limit) {
+        super(message);
+        this.limit = limit;
+    }
+
+    /**
+     * Retrieves the limit that was exceeded.
+     *
+     * @return The limit that was exceeded by the request
+     */
+    public long getLimit() {
+        return limit;
+    }
+}


=====================================
src/main/java/org/apache/commons/fileupload/FileItemStream.java
=====================================
@@ -40,7 +40,7 @@ public interface FileItemStream extends FileItemHeadersSupport {
      * {@link java.util.Iterator#hasNext()} has been invoked on the
      * iterator, which created the {@link FileItemStream}.
      */
-    public static class ItemSkippedException extends IOException {
+    class ItemSkippedException extends IOException {
 
         /**
          * The exceptions serial version UID, which is being used


=====================================
src/main/java/org/apache/commons/fileupload/FileUploadBase.java
=====================================
@@ -165,6 +165,12 @@ public abstract class FileUploadBase {
      */
     private long fileSizeMax = -1;
 
+    /**
+     * The maximum permitted number of files that may be uploaded in a single
+     * request. A value of -1 indicates no maximum.
+     */
+    private long fileCountMax = -1;
+
     /**
      * The content encoding to use when reading part headers.
      */
@@ -241,6 +247,25 @@ public abstract class FileUploadBase {
         this.fileSizeMax = fileSizeMax;
     }
 
+    /**
+     * Returns the maximum number of files allowed in a single request.
+     *
+     * @return The maximum number of files allowed in a single request.
+     */
+    public long getFileCountMax() {
+        return fileCountMax;
+    }
+
+    /**
+     * Sets the maximum number of files allowed per request.
+     *
+     * @param fileCountMax The new limit. {@code -1} means no limit.
+     */
+    public void setFileCountMax(final long fileCountMax) {
+        this.fileCountMax = fileCountMax;
+    }
+
+
     /**
      * Retrieves the character encoding used when reading the headers of an
      * individual part. When not specified, or <code>null</code>, the request
@@ -332,10 +357,15 @@ public abstract class FileUploadBase {
         try {
             FileItemIterator iter = getItemIterator(ctx);
             FileItemFactory fac = getFileItemFactory();
+            final byte[] buffer = new byte[Streams.DEFAULT_BUFFER_SIZE];
             if (fac == null) {
                 throw new NullPointerException("No FileItemFactory has been set.");
             }
             while (iter.hasNext()) {
+                if (items.size() == fileCountMax) {
+                    // The next item will exceed the limit.
+                    throw new FileCountLimitExceededException(ATTACHMENT, getFileCountMax());
+                }
                 final FileItemStream item = iter.next();
                 // Don't use getName() here to prevent an InvalidFileNameException.
                 final String fileName = ((FileItemIteratorImpl.FileItemStreamImpl) item).name;
@@ -343,7 +373,7 @@ public abstract class FileUploadBase {
                                                    item.isFormField(), fileName);
                 items.add(fileItem);
                 try {
-                    Streams.copy(item.openStream(), fileItem.getOutputStream(), true);
+                    Streams.copy(item.openStream(), fileItem.getOutputStream(), true, buffer);
                 } catch (FileUploadIOException e) {
                     throw (FileUploadException) e.getCause();
                 } catch (IOException e) {


=====================================
src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
=====================================
@@ -402,6 +402,9 @@ public class DiskFileItem
                  * in a temporary location so move it to the
                  * desired file.
                  */
+                if (file.exists()) {
+                    file.delete();
+                }
                 FileUtils.moveFile(outputFile, file);
             } else {
                 /*


=====================================
src/main/java/org/apache/commons/fileupload/util/Streams.java
=====================================
@@ -41,7 +41,7 @@ public final class Streams {
      * Default buffer size for use in
      * {@link #copy(InputStream, OutputStream, boolean)}.
      */
-    private static final int DEFAULT_BUFFER_SIZE = 8192;
+    public static final int DEFAULT_BUFFER_SIZE = 8192;
 
     /**
      * Copies the contents of the given {@link InputStream}


=====================================
src/main/java/org/apache/commons/fileupload/util/mime/Base64Decoder.java
=====================================
@@ -104,8 +104,8 @@ final class Base64Decoder {
      * @throws IOException thrown when the padding is incorrect or the input is truncated.
      */
     public static int decode(byte[] data, OutputStream out) throws IOException {
-        int        outLen = 0;
-        byte [] cache = new byte[INPUT_BYTES_PER_CHUNK];
+        int outLen = 0;
+        byte[] cache = new byte[INPUT_BYTES_PER_CHUNK];
         int cachedBytes = 0;
 
         for (byte b : data) {


=====================================
src/main/java/org/apache/commons/fileupload/util/mime/ParseException.java
=====================================
@@ -31,7 +31,7 @@ final class ParseException extends Exception {
      *
      * @param message the detail message.
      */
-    public ParseException(String message) {
+    ParseException(String message) {
         super(message);
     }
 


=====================================
src/site/resources/profile.cobertura deleted
=====================================
@@ -1,2 +0,0 @@
-# This file is intentionally empty. It is only used, because its
-# presence activates the generation of a Coberturta report.


=====================================
.travis.yml → src/site/resources/profile.jacoco
=====================================
@@ -12,14 +12,6 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
-language: java
-sudo: false
-
-jdk:
-  - openjdk7
-  - oraclejdk8
-  - oraclejdk9
-
-after_success:
-  - mvn clean test jacoco:report coveralls:report -Ptravis-jacoco
\ No newline at end of file
+# -----------------------------------------------------------------------------
+#
+# Empty file used to automatically trigger JaCoCo profile from commons parent pom


=====================================
src/site/xdoc/download_fileupload.xml
=====================================
@@ -1,126 +1,144 @@
-<?xml version="1.0"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<!--
- +======================================================================+
- |****                                                              ****|
- |****      THIS FILE IS GENERATED BY THE COMMONS BUILD PLUGIN      ****|
- |****                    DO NOT EDIT DIRECTLY                      ****|
- |****                                                              ****|
- +======================================================================+
- | TEMPLATE FILE: download-page-template.xml                            |
- | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
- +======================================================================+
- |                                                                      |
- | 1) Re-generate using: mvn commons:download-page                      |
- |                                                                      |
- | 2) Set the following properties in the component's pom:              |
- |    - commons.componentid (required, alphabetic, lower case)          |
- |    - commons.release.version (required)                              |
- |    - commons.binary.suffix (optional)                                |
- |      (defaults to "-bin", set to "" for pre-maven2 releases)         |
- |                                                                      |
- | 3) Example Properties                                                |
- |                                                                      |
- |  <properties>                                                        |
- |    <commons.componentid>math</commons.componentid>                   |
- |    <commons.release.version>1.2</commons.release.version>            |
- |  </properties>                                                       |
- |                                                                      |
- +======================================================================+
--->
-<document>
-  <properties>
-    <title>Download Apache Commons FileUpload</title>
-    <author email="dev at commons.apache.org">Commons Documentation Team</author>
-  </properties>
-  <body>
-    <section name="Download Apache Commons FileUpload">
-    <subsection name="Using a Mirror">
-      <p>
-        We recommend you use a mirror to download our release
-        builds, but you <strong>must</strong> verify the integrity of
-        the downloaded files using signatures downloaded from our main
-        distribution directories. Recent releases (48 hours) may not yet
-        be available from the mirrors.
-      </p>
-
-      <p>
-        You are currently using <b>[preferred]</b>.  If you
-        encounter a problem with this mirror, please select another
-        mirror.  If all mirrors are failing, there are <i>backup</i>
-        mirrors (at the end of the mirrors list) that should be
-        available.
-        <br></br>
-        [if-any logo]<a href="[link]"><img align="right" src="[logo]" border="0"></img></a>[end]
-      </p>
-
-      <form action="[location]" method="get" id="SelectMirror">
-        <p>
-          Other mirrors:
-          <select name="Preferred">
-          [if-any http]
-            [for http]<option value="[http]">[http]</option>[end]
-          [end]
-          [if-any ftp]
-            [for ftp]<option value="[ftp]">[ftp]</option>[end]
-          [end]
-          [if-any backup]
-            [for backup]<option value="[backup]">[backup] (backup)</option>[end]
-          [end]
-          </select>
-          <input type="submit" value="Change"></input>
-        </p>
-      </form>
-
-      <p>
-        The <a href="http://www.apache.org/dist/commons/KEYS">KEYS</a>
-        link links to the code signing keys used to sign the product.
-        The <code>PGP</code> link downloads the OpenPGP compatible signature from our main site.
-        The <code>SHA256</code> link downloads the checksum from the main site.
-      </p>
-    </subsection>
-    </section>
-    <section name="Apache Commons FileUpload 1.4 (requires Java 1.6 or later)">
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!--
+ +======================================================================+
+ |****                                                              ****|
+ |****      THIS FILE IS GENERATED BY THE COMMONS BUILD PLUGIN      ****|
+ |****                    DO NOT EDIT DIRECTLY                      ****|
+ |****                                                              ****|
+ +======================================================================+
+ | TEMPLATE FILE: download-page-template.xml                            |
+ | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
+ +======================================================================+
+ |                                                                      |
+ | 1) Re-generate using: mvn commons-build:download-page                |
+ |                                                                      |
+ | 2) Set the following properties in the component's pom:              |
+ |    - commons.componentid     (required, alphabetic, lower case)      |
+ |    - commons.release.version (required)                              |
+ |    - commons.release.name    (required)                              |
+ |    - commons.binary.suffix   (optional)                              |
+ |      (defaults to "-bin", set to "" for pre-maven2 releases)         |
+ |    - commons.release.desc    (optional)                              |
+ |    - commons.release.subdir  (optional)                              |
+ |    - commons.release.hash    (optional, lowercase, default sha512)   |
+ |                                                                      |
+ |    - commons.release.[234].version       (conditional)               |
+ |    - commons.release.[234].name          (conditional)               |
+ |    - commons.release.[234].binary.suffix (optional)                  |
+ |    - commons.release.[234].desc          (optional)                  |
+ |    - commons.release.[234].subdir        (optional)                  |
+ |    - commons.release.[234].hash       (optional, lowercase, [sha512])|
+ |                                                                      |
+ | 3) Example Properties                                                |
+ |    (commons.release.name inherited by parent:                        |
+ |     ${project.artifactId}-${commons.release.version}                 |
+ |                                                                      |
+ |  <properties>                                                        |
+ |    <commons.componentid>math</commons.componentid>                   |
+ |    <commons.release.version>1.2</commons.release.version>            |
+ |  </properties>                                                       |
+ |                                                                      |
+ +======================================================================+
+-->
+<document>
+  <properties>
+    <title>Download Apache Commons FileUpload</title>
+    <author email="dev at commons.apache.org">Apache Commons Documentation Team</author>
+  </properties>
+  <body>
+    <section name="Download Apache Commons FileUpload">
+    <subsection name="Using a Mirror">
+      <p>
+        We recommend you use a mirror to download our release
+        builds, but you <strong>must</strong> <a href="https://www.apache.org/info/verification.html">verify the integrity</a> of
+        the downloaded files using signatures downloaded from our main
+        distribution directories. Recent releases (48 hours) may not yet
+        be available from all the mirrors.
+      </p>
+
+      <p>
+        You are currently using <b>[preferred]</b>.  If you
+        encounter a problem with this mirror, please select another
+        mirror.  If all mirrors are failing, there are <i>backup</i>
+        mirrors (at the end of the mirrors list) that should be
+        available.
+        <br></br>
+        [if-any logo]<a href="[link]"><img align="right" src="[logo]" border="0"></img></a>[end]
+      </p>
+
+      <form action="[location]" method="get" id="SelectMirror">
+        <p>
+          Other mirrors:
+          <select name="Preferred">
+          [if-any http]
+            [for http]<option value="[http]">[http]</option>[end]
+          [end]
+          [if-any ftp]
+            [for ftp]<option value="[ftp]">[ftp]</option>[end]
+          [end]
+          [if-any backup]
+            [for backup]<option value="[backup]">[backup] (backup)</option>[end]
+          [end]
+          </select>
+          <input type="submit" value="Change"></input>
+        </p>
+      </form>
+
+      <p>
+        It is essential that you
+        <a href="https://www.apache.org/info/verification.html">verify the integrity</a>
+        of downloaded files, preferably using the <code>PGP</code> signature (<code>*.asc</code> files);
+        failing that using the <code>SHA512</code> hash (<code>*.sha512</code> checksum files).
+      </p>
+      <p>
+        The <a href="https://www.apache.org/dist/commons/KEYS">KEYS</a>
+        file contains the public PGP keys used by Apache Commons developers
+        to sign releases.
+      </p>
+    </subsection>
+    </section>
+    <section name="Apache Commons FileUpload 1.5 (requires Java 1.6 or later)">
       <subsection name="Binaries">
         <table>
           <tr>
-              <td><a href="[preferred]/commons/fileupload/binaries/commons-fileupload-1.4-bin.tar.gz">commons-fileupload-1.4-bin.tar.gz</a></td>
-              <td><a href="http://www.apache.org/dist/commons/fileupload/binaries/commons-fileupload-1.4-bin.tar.gz.sha256">sha256</a></td>
-              <td><a href="http://www.apache.org/dist/commons/fileupload/binaries/commons-fileupload-1.4-bin.tar.gz.asc">pgp</a></td>
+              <td><a href="[preferred]/commons/fileupload/binaries/commons-fileupload-1.5-bin.tar.gz">commons-fileupload-1.5-bin.tar.gz</a></td>
+              <td><a href="https://www.apache.org/dist/commons/fileupload/binaries/commons-fileupload-1.5-bin.tar.gz.sha512">sha512</a></td>
+              <td><a href="https://www.apache.org/dist/commons/fileupload/binaries/commons-fileupload-1.5-bin.tar.gz.asc">pgp</a></td>
           </tr>
           <tr>
-              <td><a href="[preferred]/commons/fileupload/binaries/commons-fileupload-1.4-bin.zip">commons-fileupload-1.4-bin.zip</a></td>
-              <td><a href="http://www.apache.org/dist/commons/fileupload/binaries/commons-fileupload-1.4-bin.zip.sha256">sha256</a></td>
-              <td><a href="http://www.apache.org/dist/commons/fileupload/binaries/commons-fileupload-1.4-bin.zip.asc">pgp</a></td>
+              <td><a href="[preferred]/commons/fileupload/binaries/commons-fileupload-1.5-bin.zip">commons-fileupload-1.5-bin.zip</a></td>
+              <td><a href="https://www.apache.org/dist/commons/fileupload/binaries/commons-fileupload-1.5-bin.zip.sha512">sha512</a></td>
+              <td><a href="https://www.apache.org/dist/commons/fileupload/binaries/commons-fileupload-1.5-bin.zip.asc">pgp</a></td>
           </tr>
         </table>
       </subsection>
       <subsection name="Source">
         <table>
           <tr>
-              <td><a href="[preferred]/commons/fileupload/source/commons-fileupload-1.4-src.tar.gz">commons-fileupload-1.4-src.tar.gz</a></td>
-              <td><a href="http://www.apache.org/dist/commons/fileupload/source/commons-fileupload-1.4-src.tar.gz.sha256">sha256</a></td>
-              <td><a href="http://www.apache.org/dist/commons/fileupload/source/commons-fileupload-1.4-src.tar.gz.asc">pgp</a></td>
+              <td><a href="[preferred]/commons/fileupload/source/commons-fileupload-1.5-src.tar.gz">commons-fileupload-1.5-src.tar.gz</a></td>
+              <td><a href="https://www.apache.org/dist/commons/fileupload/source/commons-fileupload-1.5-src.tar.gz.sha512">sha512</a></td>
+              <td><a href="https://www.apache.org/dist/commons/fileupload/source/commons-fileupload-1.5-src.tar.gz.asc">pgp</a></td>
           </tr>
           <tr>
-              <td><a href="[preferred]/commons/fileupload/source/commons-fileupload-1.4-src.zip">commons-fileupload-1.4-src.zip</a></td>
-              <td><a href="http://www.apache.org/dist/commons/fileupload/source/commons-fileupload-1.4-src.zip.sha256">sha256</a></td>
-              <td><a href="http://www.apache.org/dist/commons/fileupload/source/commons-fileupload-1.4-src.zip.asc">pgp</a></td>
+              <td><a href="[preferred]/commons/fileupload/source/commons-fileupload-1.5-src.zip">commons-fileupload-1.5-src.zip</a></td>
+              <td><a href="https://www.apache.org/dist/commons/fileupload/source/commons-fileupload-1.5-src.zip.sha512">sha512</a></td>
+              <td><a href="https://www.apache.org/dist/commons/fileupload/source/commons-fileupload-1.5-src.zip.asc">pgp</a></td>
           </tr>
         </table>
       </subsection>
@@ -131,7 +149,7 @@ limitations under the License.
         </p>
         <ul>
           <li class="download"><a href="[preferred]/commons/fileupload/">browse download area</a></li>
-          <li><a href="http://archive.apache.org/dist/commons/fileupload/">archives...</a></li>
+          <li><a href="https://archive.apache.org/dist/commons/fileupload/">archives...</a></li>
         </ul>
     </section>
   </body>


=====================================
src/site/xdoc/issue-tracking.xml
=====================================
@@ -26,7 +26,7 @@ limitations under the License.
  | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
  +======================================================================+
  |                                                                      |
- | 1) Re-generate using: mvn commons:jira-page                          |
+ | 1) Re-generate using: mvn commons-build:jira-page                    |
  |                                                                      |
  | 2) Set the following properties in the component's pom:              |
  |    - commons.jira.id  (required, alphabetic, upper case)             |
@@ -43,35 +43,35 @@ limitations under the License.
 -->
 <document>
   <properties>
-    <title>Commons FileUpload Issue tracking</title>
-    <author email="dev at commons.apache.org">Commons Documentation Team</author>
+    <title>Apache Commons FileUpload Issue tracking</title>
+    <author email="dev at commons.apache.org">Apache Commons Documentation Team</author>
   </properties>
   <body>
 
-    <section name="Commons FileUpload Issue tracking">
+    <section name="Apache Commons FileUpload Issue tracking">
       <p>
-      Commons FileUpload uses <a href="http://issues.apache.org/jira/">ASF JIRA</a> for tracking issues.
-      See the <a href="http://issues.apache.org/jira/browse/FILEUPLOAD">Commons FileUpload JIRA project page</a>.
+      Apache Commons FileUpload uses <a href="https://issues.apache.org/jira/">ASF JIRA</a> for tracking issues.
+      See the <a href="https://issues.apache.org/jira/browse/FILEUPLOAD">Apache Commons FileUpload JIRA project page</a>.
       </p>
 
       <p>
-      To use JIRA you may need to <a href="http://issues.apache.org/jira/secure/Signup!default.jspa">create an account</a>
+      To use JIRA you may need to <a href="https://issues.apache.org/jira/secure/Signup!default.jspa">create an account</a>
       (if you have previously created/updated Commons issues using Bugzilla an account will have been automatically
-      created and you can use the <a href="http://issues.apache.org/jira/secure/ForgotPassword!default.jspa">Forgot Password</a>
+      created and you can use the <a href="https://issues.apache.org/jira/secure/ForgotPassword!default.jspa">Forgot Password</a>
       page to get a new password).
       </p>
 
       <p>
       If you would like to report a bug, or raise an enhancement request with
-      Commons FileUpload please do the following:
+      Apache Commons FileUpload please do the following:
       <ol>
-        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310476&sorter/field=issuekey&sorter/order=DESC&status=1&status=3&status=4">Search existing open bugs</a>.
+        <li><a href="https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310476&sorter/field=issuekey&sorter/order=DESC&status=1&status=3&status=4">Search existing open bugs</a>.
             If you find your issue listed then please add a comment with your details.</li>
         <li><a href="mail-lists.html">Search the mailing list archive(s)</a>.
             You may find your issue or idea has already been discussed.</li>
         <li>Decide if your issue is a bug or an enhancement.</li>
-        <li>Submit either a <a href="http://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12310476&issuetype=1&priority=4&assignee=-1">bug report</a>
-            or <a href="http://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12310476&issuetype=4&priority=4&assignee=-1">enhancement request</a>.</li>
+        <li>Submit either a <a href="https://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12310476&issuetype=1&priority=4&assignee=-1">bug report</a>
+            or <a href="https://issues.apache.org/jira/secure/CreateIssueDetails!init.jspa?pid=12310476&issuetype=4&priority=4&assignee=-1">enhancement request</a>.</li>
       </ol>
       </p>
 
@@ -80,21 +80,21 @@ limitations under the License.
       <ul>
         <li>the more information you provide, the better we can help you</li>
         <li>test cases are vital, particularly for any proposed enhancements</li>
-        <li>the developers of Commons FileUpload are all unpaid volunteers</li>
+        <li>the developers of Apache Commons FileUpload are all unpaid volunteers</li>
       </ul>
       </p>
 
       <p>
       For more information on subversion and creating patches see the
-      <a href="http://www.apache.org/dev/contributors.html">Apache Contributors Guide</a>.
+      <a href="https://www.apache.org/dev/contributors.html">Apache Contributors Guide</a>.
       </p>
 
       <p>
       You may also find these links useful:
       <ul>
-        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310476&sorter/field=issuekey&sorter/order=DESC&status=1&status=3&status=4">All Open Commons FileUpload bugs</a></li>
-        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310476&sorter/field=issuekey&sorter/order=DESC&status=5&status=6">All Resolved Commons FileUpload bugs</a></li>
-        <li><a href="http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310476&sorter/field=issuekey&sorter/order=DESC">All Commons FileUpload bugs</a></li>
+        <li><a href="https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310476&sorter/field=issuekey&sorter/order=DESC&status=1&status=3&status=4">All Open Apache Commons FileUpload bugs</a></li>
+        <li><a href="https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310476&sorter/field=issuekey&sorter/order=DESC&status=5&status=6">All Resolved Apache Commons FileUpload bugs</a></li>
+        <li><a href="https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&pid=12310476&sorter/field=issuekey&sorter/order=DESC">All Apache Commons FileUpload bugs</a></li>
       </ul>
       </p>
     </section>


=====================================
src/site/xdoc/mail-lists.xml
=====================================
@@ -26,7 +26,7 @@ limitations under the License.
  | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
  +======================================================================+
  |                                                                      |
- | 1) Re-generate using: mvn commons:mail-page                          |
+ | 1) Re-generate using: mvn commons-build:mail-page                    |
  |                                                                      |
  | 2) Set the following properties in the component's pom:              |
  |    - commons.componentid (required, alphabetic, lower case)          |
@@ -41,15 +41,15 @@ limitations under the License.
 -->
 <document>
   <properties>
-    <title>Commons FileUpload Mailing Lists</title>
-    <author email="dev at commons.apache.org">Commons Documentation Team</author>
+    <title>Apache Commons FileUpload Mailing Lists</title>
+    <author email="dev at commons.apache.org">Apache Commons Documentation Team</author>
   </properties>
   <body>
 
     <section name="Overview">
       <p>
-        <a href="index.html">Commons FileUpload</a> shares mailing lists with all the other 
-        <a href="http://commons.apache.org/components.html">Commons Components</a>.
+        <a href="index.html">Apache Commons FileUpload</a> shares mailing lists with all the other
+        <a href="https://commons.apache.org/components.html">Commons Components</a>.
         To make it easier for people to only read messages related to components they are interested in,
         the convention in Commons is to prefix the subject line of messages with the component's name,
         for example:
@@ -58,24 +58,27 @@ limitations under the License.
         </ul>
       </p>
       <p>
-        Questions related to the usage of Commons FileUpload should be posted to the
-        <a href="http://mail-archives.apache.org/mod_mbox/commons-user/">User List</a>.
+        Questions related to the usage of Apache Commons FileUpload should be posted to the
+        <a href="https://mail-archives.apache.org/mod_mbox/commons-user/">User List</a>.
         <br />
-        The <a href="http://mail-archives.apache.org/mod_mbox/commons-dev/">Developer List</a>
-        is for questions and discussion related to the development of Commons FileUpload.
+        The <a href="https://mail-archives.apache.org/mod_mbox/commons-dev/">Developer List</a>
+        is for questions and discussion related to the development of Apache Commons FileUpload.
         <br />
         Please do not cross-post; developers are also subscribed to the user list.
+        <br />
+        You must be subscribed to post to the mailing lists.  Follow the Subscribe links below
+        to subscribe.
       </p>
       <p>
         <strong>Note:</strong> please don't send patches or attachments to any of the mailing lists.
-        Patches are best handled via the <a href="issue-tracking.html">Issue Tracking</a> system. 
-        Otherwise, please upload the file to a public server and include the URL in the mail. 
+        Patches are best handled via the <a href="issue-tracking.html">Issue Tracking</a> system.
+        Otherwise, please upload the file to a public server and include the URL in the mail.
       </p>
     </section>
 
-    <section name="Commons FileUpload Mailing Lists">
+    <section name="Apache Commons FileUpload Mailing Lists">
       <p>
-        <strong>Please prefix the subject line of any messages for <a href="index.html">Commons FileUpload</a>
+        <strong>Please prefix the subject line of any messages for <a href="index.html">Apache Commons FileUpload</a>
         with <i>[fileupload]</i></strong> - <i>thanks!</i>
         <br />
         <br />
@@ -96,16 +99,18 @@ limitations under the License.
           <td>
             <strong>Commons User List</strong>
             <br /><br />
-            Questions on using Commons FileUpload.
+            Questions on using Apache Commons FileUpload.
             <br /><br />
           </td>
           <td><a href="mailto:user-subscribe at commons.apache.org">Subscribe</a></td>
           <td><a href="mailto:user-unsubscribe at commons.apache.org">Unsubscribe</a></td>
           <td><a href="mailto:user at commons.apache.org?subject=[fileupload]">Post</a></td>
-          <td><a href="http://mail-archives.apache.org/mod_mbox/commons-user/">mail-archives.apache.org</a></td>
-          <td><a href="http://markmail.org/list/org.apache.commons.users/">markmail.org</a><br />
-              <a href="http://www.mail-archive.com/user@commons.apache.org/">www.mail-archive.com</a><br />
-              <a href="http://news.gmane.org/gmane.comp.jakarta.commons.devel">news.gmane.org</a>
+          <td><a href="https://mail-archives.apache.org/mod_mbox/commons-user/">mail-archives.apache.org</a><br />
+              <a href="https://lists.apache.org/list.html?user@commons.apache.org">lists.apache.org</a>
+          </td>
+          <td><a href="https://markmail.org/list/org.apache.commons.users/">markmail.org</a><br />
+              <a href="https://www.mail-archive.com/user@commons.apache.org/">www.mail-archive.com</a><br />
+              <a href="https://news.gmane.org/gmane.comp.jakarta.commons.devel">news.gmane.org</a>
           </td>
         </tr>
 
@@ -114,16 +119,18 @@ limitations under the License.
           <td>
             <strong>Commons Developer List</strong>
             <br /><br />
-            Discussion of development of Commons FileUpload.
+            Discussion of development of Apache Commons FileUpload.
             <br /><br />
           </td>
           <td><a href="mailto:dev-subscribe at commons.apache.org">Subscribe</a></td>
           <td><a href="mailto:dev-unsubscribe at commons.apache.org">Unsubscribe</a></td>
           <td><a href="mailto:dev at commons.apache.org?subject=[fileupload]">Post</a></td>
-          <td><a href="http://mail-archives.apache.org/mod_mbox/commons-dev/">mail-archives.apache.org</a></td>
-          <td><a href="http://markmail.org/list/org.apache.commons.dev/">markmail.org</a><br />
-              <a href="http://www.mail-archive.com/dev@commons.apache.org/">www.mail-archive.com</a><br />
-              <a href="http://news.gmane.org/gmane.comp.jakarta.commons.devel">news.gmane.org</a>
+          <td><a href="https://mail-archives.apache.org/mod_mbox/commons-dev/">mail-archives.apache.org</a><br />
+              <a href="https://lists.apache.org/list.html?dev@commons.apache.org">lists.apache.org</a>
+          </td>
+          <td><a href="https://markmail.org/list/org.apache.commons.dev/">markmail.org</a><br />
+              <a href="https://www.mail-archive.com/dev@commons.apache.org/">www.mail-archive.com</a><br />
+              <a href="https://news.gmane.org/gmane.comp.jakarta.commons.devel">news.gmane.org</a>
           </td>
         </tr>
 
@@ -138,9 +145,11 @@ limitations under the License.
           <td><a href="mailto:issues-subscribe at commons.apache.org">Subscribe</a></td>
           <td><a href="mailto:issues-unsubscribe at commons.apache.org">Unsubscribe</a></td>
           <td><i>read only</i></td>
-          <td><a href="http://mail-archives.apache.org/mod_mbox/commons-issues/">mail-archives.apache.org</a></td>
-          <td><a href="http://markmail.org/list/org.apache.commons.issues/">markmail.org</a><br />
-              <a href="http://www.mail-archive.com/issues@commons.apache.org/">www.mail-archive.com</a>
+          <td><a href="https://mail-archives.apache.org/mod_mbox/commons-issues/">mail-archives.apache.org</a><br />
+              <a href="https://lists.apache.org/list.html?issues@commons.apache.org">lists.apache.org</a>
+          </td>
+          <td><a href="https://markmail.org/list/org.apache.commons.issues/">markmail.org</a><br />
+              <a href="https://www.mail-archive.com/issues@commons.apache.org/">www.mail-archive.com</a>
           </td>
         </tr>
 
@@ -149,15 +158,17 @@ limitations under the License.
           <td>
             <strong>Commons Commits List</strong>
             <br /><br />
-            Only for e-mails automatically generated by the <a href="source-repository.html">source control</a> sytem.
+            Only for e-mails automatically generated by the <a href="scm.html">source control</a> sytem.
             <br /><br />
           </td>
           <td><a href="mailto:commits-subscribe at commons.apache.org">Subscribe</a></td>
           <td><a href="mailto:commits-unsubscribe at commons.apache.org">Unsubscribe</a></td>
           <td><i>read only</i></td>
-          <td><a href="http://mail-archives.apache.org/mod_mbox/commons-commits/">mail-archives.apache.org</a></td>
-          <td><a href="http://markmail.org/list/org.apache.commons.commits/">markmail.org</a><br />
-              <a href="http://www.mail-archive.com/commits@commons.apache.org/">www.mail-archive.com</a>
+          <td><a href="https://mail-archives.apache.org/mod_mbox/commons-commits/">mail-archives.apache.org</a><br />
+              <a href="https://lists.apache.org/list.html?commits@commons.apache.org">lists.apache.org</a>
+          </td>
+          <td><a href="https://markmail.org/list/org.apache.commons.commits/">markmail.org</a><br />
+              <a href="https://www.mail-archive.com/commits@commons.apache.org/">www.mail-archive.com</a>
           </td>
         </tr>
 
@@ -185,14 +196,16 @@ limitations under the License.
             General announcements of Apache project releases.
             <br /><br />
           </td>
-          <td><a class="externalLink" href="mailto:announce-subscribe at apache.org">Subscribe</a></td> 
-          <td><a class="externalLink" href="mailto:announce-unsubscribe at apache.org">Unsubscribe</a></td> 
+          <td><a class="externalLink" href="mailto:announce-subscribe at apache.org">Subscribe</a></td>
+          <td><a class="externalLink" href="mailto:announce-unsubscribe at apache.org">Unsubscribe</a></td>
           <td><i>read only</i></td>
-          <td><a class="externalLink" href="http://mail-archives.apache.org/mod_mbox/www-announce/">mail-archives.apache.org</a></td> 
-          <td><a class="externalLink" href="http://markmail.org/list/org.apache.announce/">markmail.org</a><br />
-              <a class="externalLink" href="http://old.nabble.com/Apache-News-and-Announce-f109.html">old.nabble.com</a><br />
-              <a class="externalLink" href="http://www.mail-archive.com/announce@apache.org/">www.mail-archive.com</a><br />
-              <a class="externalLink" href="http://news.gmane.org/gmane.comp.apache.announce">news.gmane.org</a>
+          <td><a class="externalLink" href="https://mail-archives.apache.org/mod_mbox/www-announce/">mail-archives.apache.org</a><br />
+              <a class="externalLink" href="https://lists.apache.org/list.html?announce@apache.org">lists.apache.org</a>
+          </td>
+          <td><a class="externalLink" href="https://markmail.org/list/org.apache.announce/">markmail.org</a><br />
+              <a class="externalLink" href="https://old.nabble.com/Apache-News-and-Announce-f109.html">old.nabble.com</a><br />
+              <a class="externalLink" href="https://www.mail-archive.com/announce@apache.org/">www.mail-archive.com</a><br />
+              <a class="externalLink" href="https://news.gmane.org/gmane.comp.apache.announce">news.gmane.org</a>
           </td>
         </tr>
       </table>


=====================================
src/test/java/org/apache/commons/fileupload/DiskFileUploadTest.java
=====================================
@@ -16,10 +16,14 @@
  */
 package org.apache.commons.fileupload;
 
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.commons.fileupload.disk.DiskFileItem;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -64,4 +68,28 @@ public class DiskFileUploadTest {
         }
     }
 
+    /** Proposed test for FILEUPLOAD-293. As of yet, doesn't reproduce the problem.
+     */
+    @Test
+    public void testMoveFile() throws Exception {
+        DiskFileUpload myUpload = new DiskFileUpload();
+        myUpload.setSizeThreshold(0);
+    	final String content =
+                "-----1234\r\n" +
+                "Content-Disposition: form-data; name=\"file\";"
+                		+ "filename=\"foo.tab\"\r\n" +
+                "Content-Type: text/whatever\r\n" +
+                "\r\n" +
+                "This is the content of the file\n" +
+                "\r\n" +
+                "-----1234--\r\n";
+    	final byte[] contentBytes = content.getBytes("US-ASCII");
+        final HttpServletRequest request = new MockHttpServletRequest(contentBytes, Constants.CONTENT_TYPE);
+        final List<FileItem> items = myUpload.parseRequest(request);
+        assertNotNull(items);
+        assertFalse(items.isEmpty());
+        final DiskFileItem dfi = (DiskFileItem) items.get(0);
+        final File out = File.createTempFile("install", ".tmp");
+        dfi.write(out);
+    }
 }


=====================================
src/test/java/org/apache/commons/fileupload/util/mime/MimeUtilityTestCase.java
=====================================
@@ -20,7 +20,6 @@ import static org.junit.Assert.assertEquals;
 
 import java.io.UnsupportedEncodingException;
 
-import org.apache.commons.fileupload.util.mime.MimeUtility;
 import org.junit.Test;
 
 /**
@@ -38,12 +37,12 @@ public final class MimeUtilityTestCase {
 
     @Test
     public void decodeUtf8QuotedPrintableEncoded() throws Exception {
-        assertEncoded(" h! u !!!", "=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?=");
+        assertEncoded(" h\u00e9! \u00e0\u00e8\u00f4u !!!", "=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?=");
     }
 
     @Test
     public void decodeUtf8Base64Encoded() throws Exception {
-        assertEncoded(" h! u !!!", "=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=");
+        assertEncoded(" h\u00e9! \u00e0\u00e8\u00f4u !!!", "=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=");
     }
 
     @Test



View it on GitLab: https://salsa.debian.org/java-team/libcommons-fileupload-java/-/commit/1a706f08b6aac2acb19a684420622d85f8400f70

-- 
View it on GitLab: https://salsa.debian.org/java-team/libcommons-fileupload-java/-/commit/1a706f08b6aac2acb19a684420622d85f8400f70
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20240227/0a6fb0de/attachment.htm>


More information about the pkg-java-commits mailing list