This is an automated email from the ASF dual-hosted git repository. sebb pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-fileupload.git
The following commit(s) were added to refs/heads/master by this push: new fe5c5e4e Normalize EOL fe5c5e4e is described below commit fe5c5e4efd35374120f9a40539b6d2a13af25b83 Author: Sebb <s...@apache.org> AuthorDate: Sat Jan 18 21:22:59 2025 +0000 Normalize EOL --- .gitattributes | 2 + .github/workflows/maven.yml | 102 +-- spotbugs-exclude-filter.xml | 138 ++-- src/changes/changes.xml | 1424 ++++++++++++++++++++--------------------- src/site/apt/migration.apt.vm | 360 +++++------ 5 files changed, 1014 insertions(+), 1012 deletions(-) diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..db173deb --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto +*.patch -text diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c8767e6a..ca687915 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,56 +1,56 @@ -# 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. - -name: Java CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-latest - continue-on-error: ${{ matrix.experimental }} - strategy: - matrix: - java: [ 11, 17, 21, 23 ] - experimental: [false] - include: - - java: 24-ea - experimental: true - - steps: +# 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. + +name: Java CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} + strategy: + matrix: + java: [ 11, 17, 21, 23 ] + experimental: [false] + include: + - java: 24-ea + experimental: true + + steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Set up JDK ${{ matrix.java }} + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 - with: - distribution: 'temurin' - java-version: ${{ matrix.java }} - - name: Build with Maven - run: mvn --errors --show-version --batch-mode --no-transfer-progress + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + - name: Build with Maven + run: mvn --errors --show-version --batch-mode --no-transfer-progress diff --git a/spotbugs-exclude-filter.xml b/spotbugs-exclude-filter.xml index d7f1da8d..8799cdfd 100644 --- a/spotbugs-exclude-filter.xml +++ b/spotbugs-exclude-filter.xml @@ -1,69 +1,69 @@ -<?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 contains some false positive bugs detected by spotbugs. Their - false positive nature has been analyzed individually and they have been - put here to instruct findbugs it must ignore them. ---> -<FindBugsFilter - xmlns="https://github.com/spotbugs/filter/3.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd"> - - <!-- https://github.com/spotbugs/spotbugs/issues/2710 --> - <Match> - <Class name="~.*" /> - <Bug pattern="CT_CONSTRUCTOR_THROW" /> - </Match> - <!-- Reason: Initial commit. Need to refine --> - <Match> - <Class name="org.apache.commons.fileupload2.MultipartStream" /> - <Method name="readHeaders" /> - <Bug pattern="DM_DEFAULT_ENCODING" /> - </Match> - <Match> - <Class name="org.apache.commons.fileupload2.MultipartStream" /> - <Bug pattern="MS_PKGPROTECT" /> - </Match> - <Match> - <Class name="org.apache.commons.fileupload2.disk.DiskFileItem" /> - <Bug pattern="DM_DEFAULT_ENCODING" /> - </Match> - <Match> - <Class name="org.apache.commons.fileupload2.disk.DiskFileItem" /> - <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" /> - </Match> - <Match> - <Class name="org.apache.commons.fileupload2.disk.DiskFileItem" /> - <Method name="getString" /> - <Bug pattern="DLS_DEAD_LOCAL_STORE" /> - </Match> - <Match> - <Class name="org.apache.commons.fileupload2.jaksrvlt.JakartaServletFileUpload " /> - <Bug pattern="NM_WRONG_PACKAGE" /> - </Match> - <Match> - <Class name="org.apache.commons.fileupload2.util.Streams" /> - <Method name="asString" /> - <Bug pattern="DM_DEFAULT_ENCODING" /> - </Match> - <Match> - <Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2" /> - </Match> -</FindBugsFilter> +<?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 contains some false positive bugs detected by spotbugs. Their + false positive nature has been analyzed individually and they have been + put here to instruct findbugs it must ignore them. +--> +<FindBugsFilter + xmlns="https://github.com/spotbugs/filter/3.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd"> + + <!-- https://github.com/spotbugs/spotbugs/issues/2710 --> + <Match> + <Class name="~.*" /> + <Bug pattern="CT_CONSTRUCTOR_THROW" /> + </Match> + <!-- Reason: Initial commit. Need to refine --> + <Match> + <Class name="org.apache.commons.fileupload2.MultipartStream" /> + <Method name="readHeaders" /> + <Bug pattern="DM_DEFAULT_ENCODING" /> + </Match> + <Match> + <Class name="org.apache.commons.fileupload2.MultipartStream" /> + <Bug pattern="MS_PKGPROTECT" /> + </Match> + <Match> + <Class name="org.apache.commons.fileupload2.disk.DiskFileItem" /> + <Bug pattern="DM_DEFAULT_ENCODING" /> + </Match> + <Match> + <Class name="org.apache.commons.fileupload2.disk.DiskFileItem" /> + <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" /> + </Match> + <Match> + <Class name="org.apache.commons.fileupload2.disk.DiskFileItem" /> + <Method name="getString" /> + <Bug pattern="DLS_DEAD_LOCAL_STORE" /> + </Match> + <Match> + <Class name="org.apache.commons.fileupload2.jaksrvlt.JakartaServletFileUpload " /> + <Bug pattern="NM_WRONG_PACKAGE" /> + </Match> + <Match> + <Class name="org.apache.commons.fileupload2.util.Streams" /> + <Method name="asString" /> + <Bug pattern="DM_DEFAULT_ENCODING" /> + </Match> + <Match> + <Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2" /> + </Match> +</FindBugsFilter> diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 34ff3f21..58de6e81 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -1,712 +1,712 @@ -<?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 used by the maven-changes-plugin to generate the release notes. -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 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 -property to the number of days since the last release. - - -The <action> type attribute can be add,update,fix,remove. ---> - -<document xmlns="http://maven.apache.org/changes/2.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/changes/2.0.0 https://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-2.0.0.xsd"> - <properties> - <title>Apache Commons FileUpload Release Notes</title> - <author email="d...@commons.apache.org">Apache Commons Developers</author> - </properties> - <body> - <release version="2.0.0" date="2024-MM-DD" description="2.0.0 Release, requires Java 11."> - <!-- FIX --> - <action type="fix" dev="ggregory" due-to="Gregor Dschung">[site] Fix instantiation of DiskFileItemFactory in migration guide #273.</action> - <action issue="FILEUPLOAD-355" type="fix" dev="ggregory" due-to="Ana, Gary Gregory">[site] Update code example: Use IOUtils instead of Streams utils class.</action> - <action type="fix" dev="ggregory" due-to="Gary Gregory">Replace internal use of Locale.ENGLISH with Locale.ROOT.</action> - <action type="fix" dev="ggregory" due-to="Gary Gregory">Pick up JUnit version from parent POM.</action> - <action issue="FILEUPLOAD-356" type="fix" dev="ggregory" due-to="Mattias Reichel, GirirajSinghRathore, Gary Gregory">[site] Fix incorrect link to changes report in Commons FileUpload #357.</action> - <action type="fix" dev="ggregory" due-to="Filipe Roque">Fix changes report link for new version of Maven Changes plugin from commons-parent 79 #388.</action> - <!-- ADD --> - <action dev="ggregory" type="add" due-to="mufasa1976, Gary Gregory">Handle multipart/related Requests without content-disposition header.</action> - <!-- UDPATE --> - <action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 66 to 79 #283, #294, #335, #343, #345, #351, #356, #360, #368.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons-io:commons-io from 2.16.0 to 2.18.0 #297, #352, #377.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.3 to 3.7.0 #319.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.codehaus.mojo:taglist-maven-plugin from 3.0.0 to 3.1.0 #327.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.17.0 #331, #338, #346.</action> - </release> - <release version="2.0.0-M2" date="2023-12-24" description="2.0.0-M2 Release, requires Java 11."> - <!-- FIX --> - <action dev="ggregory" type="fix" due-to="James Reeves">Fix off-by-one error when checking fileSizeMax in FileItemInputImpl #235.</action> - <action issue="FILEUPLOAD-352" dev="ggregory" type="fix" due-to="Björn Kautler, Gary Gregory">NullPointerException in DiskFileItem#toString.</action> - <action dev="ggregory" type="fix" due-to="Gary Gregory">Fail fast on null inputs to org.apache.commons.fileupload2.core.AbstractRequestContext.AbstractRequestContext(Function, LongSupplier, T).</action> - <action dev="ggregory" type="fix" due-to="Gary Gregory">Complete refactoring in JakartaServletRequestContext.</action> - <action dev="ggregory" type="fix" due-to="Gary Gregory">Fix "Implicit narrowing conversion in compound assignment" from https://github.com/apache/commons-fileupload/security/code-scanning/118.</action> - <action dev="ggregory" type="fix" due-to="Gary Gregory">Pick up Maven Moditect plugin version from parent POM.</action> - <!-- ADD --> - <action dev="ggregory" type="add" due-to="Gary Gregory">Refactor to support Jakarta Servlet 5 and 6.</action> - <action dev="ggregory" type="add" due-to="Michal H Siemaszko, Gary Gregory">Generate some OSGi metadata.</action> - <!-- UDPATE --> - <action dev="ggregory" type="update" due-to="Dependabot">Bump Java from 8 to 11.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons-parent from 58 to 65.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons-lang3 from 3.12.0 to 3.14.0.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons-io from 2.13.0 to 2.16.0 #291.</action> - </release> - <release version="2.0.0-M1" date="2023-07-14" description="2.0.0-M1 Release, requires Java 8."> - <!-- FIX --> - <action dev="jochen" type="fix">Changing Maven coordinates, and package name, due to binary incompatible changes.</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 issue="FILEUPLOAD-296" dev="jochen" type="fix" due-to="David Georg Reochelt">Performance gains by reusing an internal buffer.</action> - <action issue="FILEUPLOAD-274" dev="jochen" type="fix" due-to="Merbin J Anselm" due-to-email="merbinjans...@gmail.com">RFC 5987 compliance</action> - <action dev="ggregory" type="fix" due-to="Emmanuel Lécharny">Slight optim: resuse the index position instead of recomputing it #49.</action> - <action issue="FILEUPLOAD-340" dev="mgrigorov" type="fix">Make commons-fileupload2 a JPMS module by adding module-info.class.</action> - <action issue="FILEUPLOAD-341" dev="jochen" type="fix" due-to="Martin Grigorov">Move Exception classes out of the impl package.</action> - <action dev="ggregory" type="fix" due-to="Gary Gregory">Rework exceptions to use propagated exception causes (introduced in Java 1.4).</action> - <action dev="ggregory" type="fix" due-to="Gary Gregory">All custom exception extend FileUploadException.</action> - <action dev="ggregory" type="fix" due-to="Gary Gregory">All custom exceptions serialVersionUID value is now 2.</action> - <action issue="FILEUPLOAD-350" dev="ggregory" type="fix" due-to="Ernesto Reinaldo Barreiro">FileUploadByteCountLimitException ctor switches fileName and fieldName parameters #216.</action> - <action dev="ggregory" type="fix" due-to="step-security-bot, Gary Gregory">[StepSecurity] ci: Harden GitHub Actions #224.</action> - <!-- ADD --> - <action dev="ggregory" type="add" due-to="Gary Gregory">Add github/codeql-action from #144.</action> - <action dev="jochen" type="add">Add the package org.apache.fileupload2.jaksrvlt, for compliance with Jakarta Servlet API 5.0.</action> - <action dev="jochen" type="add">Making FileUploadException a subclass of IOException. (Mibor API simplification.)</action> - <action dev="markt" type="add">Add a configurable limit (disabled by default) for the number of files to upload per request.</action> - <!-- REMOVE --> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated constructors in MultipartStream.</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated RequestContext.getContentLength().</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated JakSrvltRequestContext.getContentLength().</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated PortletRequestContext.getContentLength().</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated ServletRequestContext.getContentLength().</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.MAX_HEADER_SIZE.</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.createItem(Map, boolean).</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.getFieldName(Map).</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.getFileName(Map).</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.getHeader(Map, String).</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.parseHeaders(String).</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Replace org.apache.commons.fileupload2.util.mime.Base64Decoder with java.util.Base64.</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Replace LimitedInputStream with BoundedInputStream.</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">FileItemHeadersImpl is no longer Serializable.</action> - <action dev="ggregory" type="remove" due-to="Gary Gregory">Reuse Java's InvalidPathException instead of the custom InvalidFileNameException.</action> - <!-- UPDATE --> - <action dev="ggregory" type="update" due-to="Dependabot, Gary Gregory">Bump actions/cache from 2.1.6 to 3.0.8 #128, #140.</action> - <action dev="ggregory" type="update" due-to="Dependabot, Gary Gregory">Bump actions/checkout from 2.3.4 to 3.0.2 #125.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory">Bump build actions/setup-java from 1.4.3 to 3.8.0 #142, #175, #180, #182.</action> - <action dev="jochen" type="update">Bump Java compiler level to 1.8.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory, Dependabot">Bump commons-io:commons-io 2.6 to 2.13.0, #104, #221.</action> - <action dev="ggregory" type="update" due-to="Dependabot">Bump junit-jupiter from 5.5.2 to 5.9.1 #31, #130, #156, #166.</action> - <action dev="ggregory" type="update" due-to="Dependabot">Bump maven-pmd-plugin from 3.13.0 to 3.19.0 #48, #162.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons.japicmp.version from 0.13.0 to 0.16.0.</action> - <action dev="ggregory" type="update" due-to="Dependabot">Bump spotbugs-maven-plugin from 4.2.3 to 4.7.3.0 #103, #133, #141, #146, #155, #163, #179.</action> - <action dev="jochen" type="update" due-to="Dependabot">Bump spotbugs from 4.2.3 to 4.7.3, ignore EI_EXPOSE_REP, and EI_EXPOSE_REP2, #152, #161, #174.</action> - <action dev="ggregory" type="update" due-to="Dependabot">Bump biz.aQute.bndlib from 6.0.0 to 6.4.0 #129, #181.</action> - <action dev="ggregory" type="update" due-to="Gary Gregory, Dependabot">Bump commons-parent from 52 to 58, #167, #183, #194.</action> - <action dev="ggregory" type="update" due-to="Dependabot">Bump maven-checkstyle-plugin from 3.1.2 to 3.2.0 #160.</action> - </release> - <release version="1.5" date="2023-02-01" description="1.5 Release"> - </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> - <action issue="FILEUPLOAD-252" dev="tn" type="fix">DiskFileItem#write() could lose original IO exception</action> - <action issue="FILEUPLOAD-258" dev="tn" type="fix">DiskFileItem#getStoreLocation() wrongly returned a File object for items stored in memory</action> - <action issue="FILEUPLOAD-242" dev="tn" type="fix">FileUploadBase - should not silently catch and ignore all Throwables</action> - <action issue="FILEUPLOAD-257" dev="tn" type="fix">Fix Javadoc 1.8.0 errors</action> - <action issue="FILEUPLOAD-234" dev="tn" type="fix">Fix section "Resource cleanup" of the user guide</action> - <action issue="FILEUPLOAD-237" dev="tn" type="fix">Fix streaming example: use FileItem.getInputStream() instead of openStream()</action> - <action issue="FILEUPLOAD-248" dev="ecki" type="fix">DiskFileItem might suppress critical IOExceptions on rename - use FileUtil.move instead</action> - <action issue="FILEUPLOAD-251" dev="sebb" type="fix">DiskFileItem#getTempFile() is broken</action> - <action issue="FILEUPLOAD-250" dev="sebb" type="fix">FileUploadBase - potential resource leak - InputStream not closed on exception</action> - <action issue="FILEUPLOAD-244" dev="sebb" type="fix">DiskFileItem.readObject fails to close FileInputStream</action> - <action issue="FILEUPLOAD-246" dev="sebb" type="update">FileUpload should use IOUtils.closeQuietly where relevant</action> - <action issue="FILEUPLOAD-245" dev="sebb" type="fix">DiskFileItem.get() may not fully read the data</action> - <action issue="FILEUPLOAD-243" dev="sebb" type="update" due-to="Ville Skyttä">Make some MultipartStream private fields final</action> - <action dev="ecki" type="add">Site: added security report</action> - <action type="fix" dev="markt" due-to="Felix Schumacher">Improve performance for large multi-part boundaries</action> - <action type="add" issue="FILEUPLOAD-286" dev="jochen" due-to="maxxedev" due-to-email="maxxe...@gmail.com">Added the default character set to the DiskFileItem.</action> - <action type="fix" issue="FILEUPLOAD-288" dev="jochen" due-to="fangwentong" due-to-email="fangwentong2...@gmail.com">Avoid using File.exists() on temporary files, if we know that the file has been created.</action> - <action type="add" dev="jochen" due-to="Pascal Schumacher">Added .travis.yml, to fix build issues on Github.</action> - </release> - - <release version="1.3.3" description="Bugfix release for 1.3.3" date="2017-06-13"> - <action issue="FILEUPLOAD-279" dev="jochen" type="fix"> - DiskDileItem can actually no longer be deserialized, unless a system property is set to true. - </action> - </release> - - <release version="1.3.2" description="Bugfix release for 1.3.1" date="2016.05-26"> - <action issue="FILEUPLOAD-272" dev="jochen" type="update"> - SECURITY - CVE-2016-3092. Performance Improvement in MultipartStream. - </action> - </release> - - <release version="1.3.2" description= -"This is a security and maintenance release that includes an important security -fix as well. Compared to 1.3.1, no other changes have been made." date="2014-02-07"> - <action dev="jochen" type="fix"> - SECURITY - CVE-2016-3092. Specially crafted input can trigger a DoS, if the - size of the MIME boundard is close to the size of the buffer in MultipartStream. - (Similar to CVE-2014-0050.) - </action> - </release> - <release version="1.3.1" description= -"This is a security and maintenance release that includes an important security -fix as well as a small number of bugfixes." date="2014-02-07"> - <action dev="markt" type="fix"> - SECURITY - CVE-2014-0050. Specially crafted input can trigger a DoS if the - buffer used by the MultipartStream is not big enough. When constructing - MultipartStream enforce the requirements for buffer size by throwing an - IllegalArgumentException if the requested buffer size is too small. This - prevents the DoS. - </action> - <action dev="markt" type="fix" due-to="Arun Babu Neelicattu" due-to-email="a...@redhat.com"> - When deserializing DiskFileItems ensure that the repository location, if - any, is a valid one. - </action> - <action dev="markt" type="fix"> - Correct example in usage documentation so it compiles. - </action> - </release> - - <release version="1.3" description="maintenance release, JDK1.5 update" date="2013-03-27"> - <!-- important notes --> - <action dev="markt" type="fix"> - SECURITY - CVE-2013-0248. Update the Javadoc and documentation to make - it clear that setting a repository is required for a secure - configuration if there are local, untrusted users. - </action> - <!-- Sub-task --> - <action issue="FILEUPLOAD-216" dev="simonetripodi" type="update"> - Update the project tree dirs according to default Maven conventions - </action> - <action issue="FILEUPLOAD-217" dev="simonetripodi" type="update"> - drop JDK1.3 support and update to Java5 - </action> - <action issue="FILEUPLOAD-218" dev="simonetripodi" type="update"> - Update version in POM - </action> - <action issue="FILEUPLOAD-219" dev="simonetripodi" type="update"> - upgrade tests to JUnit 4 - </action> - <action issue="FILEUPLOAD-220" dev="simonetripodi" type="update"> - replace package.html with package-info.java - </action> - <action issue="FILEUPLOAD-221" dev="simonetripodi" type="update"> - FileItemHeadersImpl can now use LinkedHashMap - </action> - <action issue="FILEUPLOAD-222" dev="simonetripodi" type="update"> - Mark @deprecated classes/methods with @Deprecated annotation - </action> - <action issue="FILEUPLOAD-233" dev="sebb" type="fix" due-to="Simone Tripodi"> - Base64Decoder doesn't correctly implement RFC 4648 - </action> - <!-- Bug --> - <action issue="FILEUPLOAD-143" dev="jochen" type="fix" due-to="Luke Scott"> - "Stream ended unexpectedly" when posting from a Flash client - </action> - <action issue="FILEUPLOAD-173" dev="simonetripodi" type="fix" due-to="Bjorn Harvold"> - Manifest for OSGi has invalid syntax - </action> - <action issue="FILEUPLOAD-183" dev="simonetripodi" type="fix" due-to="Roman Arkadijovych Muntyanu"> - commons-io dependency does not get loaded by maven if only dependency to commons-fileupload is specified - </action> - <action issue="FILEUPLOAD-185" dev="simonetripodi" type="fix" due-to="Sebb"> - https://commons.apache.org/fileupload/index.html is out of date - </action> - <action issue="FILEUPLOAD-186" dev="simonetripodi" type="fix" due-to="Sebb"> - https://commons.apache.org/fileupload/index.html should not mention nightly builds - </action> - <action issue="FILEUPLOAD-189" dev="simonetripodi" type="fix" due-to="Gregor K"> - DiskFileItemFactory use of FileCleaningTracker is documented or coded wrong - proposal submitted by Jan Novotný - </action> - <action issue="FILEUPLOAD-195" dev="simonetripodi" type="fix" due-to="Juliano Alves"> - Error reading the file size larger than 2 gb - pull request from Gergely - </action> - <action issue="FILEUPLOAD-197" dev="simonetripodi" type="fix" due-to="David Wolverton"> - ServletFileUpload isMultipartContent method does not support HTTP PUT - thanks Roy T. Fielding and Jochen Wiedmann - </action> - <action issue="FILEUPLOAD-199" dev="simonetripodi" type="fix" due-to="Mark Thomas"> - Uploads have unexpected results for files with non-ASCII names - support RFC2047 - thanks Thomas Neidhart - </action> - <action issue="FILEUPLOAD-202" dev="tn" type="fix" due-to="tina"> - Exceptions resulting from upload size limitations (fileSizeMax, sizeMax) - are now correctly propagated to the caller (these could be encountered - formerly as MalformedStreamException: "Stream ended unexpectedly"). - </action> - <action issue="FILEUPLOAD-204" dev="jochen" type="fix" due-to="Hakju Oh"> - FileItem.getHeaders() returns always null. - </action> - <action issue="FILEUPLOAD-212" dev="tn" type="fix" due-to="Damian Kolasa"> - The sizeMax parameter within FileUpload is now correctly enforced if - no content length header is provided. - </action> - <action issue="FILEUPLOAD-214" dev="simonetripodi" type="fix" due-to="Matthew Runo"> - ServletFileUpload only accepts POST requests - </action> - <action issue="FILEUPLOAD-228" dev="simonetripodi" type="fix" due-to="Thomas Neidhart"> - (Servlet|Portlet)RequestContext#contentLength() must return request.getContentLength() if Content-length header is not available - </action> - <action issue="FILEUPLOAD-229" dev="simonetripodi" type="fix" due-to="seb"> - toLowerCase() is Locale-dependent; should use toLowerCase(Locale.ENGLISH) instead - </action> - <action issue="FILEUPLOAD-229" dev="sebb,simonetripodi" type="fix" due-to="seb"> - There are no unit tests for the new utils.mime classes - </action> - <!-- Improvement --> - <action issue="FILEUPLOAD-182" dev="simonetripodi" type="add" due-to="Chris Lott"> - Documentation: add simple HTML form example to fileupload user guide - </action> - <action issue="FILEUPLOAD-207" dev="simonetripodi" type="add" due-to="frank"> - enhance file read/write performance - patch provided by frank - </action> - <action issue="FILEUPLOAD-209" dev="simonetripodi" type="add" due-to="Fernando Ribeiro"> - Add Support for Generic Types - </action> - <action issue="FILEUPLOAD-210" dev="simonetripodi" type="add" due-to="Fernando Ribeiro"> - Process HTTP Requests Into Maps - </action> - <action issue="FILEUPLOAD-223" dev="simonetripodi" type="update" due-to=""> - Update commons-io dependency to latest version that supports JDK1.5 - </action> - <action issue="FILEUPLOAD-224" dev="simonetripodi" type="update"> - Avoid string concatenations while parsing headers, use buffers instead - </action> - <action issue="FILEUPLOAD-225" dev="simonetripodi" type="update"> - Replace java.rmi.server.UID() with java.util.UUID - </action> - <action issue="FILEUPLOAD-226" dev="sebb" type="update"> - DiskFileItem.counter could be converted to AtomicInteger (or AtomicLong?) - </action> - <action issue="FILEUPLOAD-227" dev="sebb" type="update"> - Private immutable fields which could be final - </action> - <!-- Task --> - <action issue="FILEUPLOAD-201" dev="simonetripodi" type="update"> - Update to JDK 1.5 and bump IO dependency to 2.0.1 - </action> - <action issue="FILEUPLOAD-215" dev="simonetripodi" type="update"> - version 1.3 improvement tasks - </action> - </release> - - <release version="1.2.2" date="2010-07-29"> - <action dev="jochen" type="fix" - due-to="Daniel Fabian" due-to-email="dfab...@google.com"> - Added a check for file names containing a NULL characters. Such file - names are now triggering an InvalidFileNameException since the file name - cannot be used as provided to create the file since it will be truncated - at the NUL character on most (all?) operating systems. E.g. a file name - like "test.foo0.bar" would result in "test.foo" being created. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-160" - due-to="Stepan Koltsov" due-to-email="y...@mx1.ru"> - Temporary files have not been deleted, if an error - occurred in FileUploadBase.parseRequest(); - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-158" - due-to="Stepan Koltsov" due-to-email="y...@mx1.ru"> - Fixed example in MultipartStream Javadocs. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-157" - due-to="Paul Spurr" due-to-email="psp...@gmail.com"> - Ensured, that the ProgressListener is called for all - items. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-156"> - Made the ProgressNotifier public. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-155" - due-to="Jörg Heinicke" due-to-email="joerg.heini...@gmx.de"> - Multiple documentation fixes. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-152" - due-to="Duzakropka" due-to-email="duzakrop...@gmail.com"> - Fixed the error message for FileSizeLimitExceededException - from "too many characters" to "too many bytes". - </action> - <action dev="jochen" type="add" issue="FILEUPLOAD-154"> - A FileSizeLimitExceededException does now contain the - file and field name of the item, which caused the problem. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-130" - due-to="Guillaume Cottenceau" due-to-email="cott...@gmail.com"> - The FileItemHeader stuff hasn't been actually working. - </action> - </release> - - <release version="1.2.1" date="2008-01-18"> - <action dev="jochen" type="fix"> - Upgrade to commons-io-1.4-SNAPSHOT, in order to use the new - FileCleaningTracker and fix issues with FileCleaner. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-129"> - Made the MockHttpServletRequest comply to the servlet 2.4 specification - by applying - http://www.sourcelabs.com/dashboards/sash-1.2/patches/commons-fileupload-1.1-1/SUP-520.diff - </action> - <action dev="jochen" type="add" issue="FILEUPLOAD-130" - due-to="Michael Macaluso" due-to-email="michael.pub...@wavecorp.com"> - Added support for accessing the file item headers. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-116" - due-to="Amichai Rothman" due-to-email="amich...@amichais.net"> - A MalformedStreamException is now thrown, if the size of an items - headers exceeds HEADER_PART_SIZE_MAX; - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-134" - due-to="Thomas Vandahl" due-to-email="t...@apache.org"> - DiskFileItem.toString() could throw an NPE. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-135" - due-to="Alexander Sova" due-to-email="b...@noir.crocodile.org"> - Short files could cause an unexpected end of the item stream. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-145"> - A FileSizeLimitExceededException was deferred until the complete - file has been uploaded. Additionally, the FileSizeLimitException - is now thrown immediately, if the attachments headers contain - a content-length value, which exceeds the configured limit. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-153" - due-to="Gary Gregory" due-to-email="ggreg...@seagullsw.com"> - Fixed a classpath problem when building with Sun JDK 1.3.1 - and Ant. - </action> - </release> - - <release version="1.2" date="2007-02-13"> - <action dev="jochen" type="fix" due-to="Aaron Freeman" - due-to-email="aa...@sendthisfile.com"> - Made Streams.asString static. - </action> - <action dev="jochen" type="update" issue="FILEUPLOAD-109"> - Eliminated duplicate code. - </action> - <action dev="jochen" type="add" issue="FILEUPLOAD-112"> - Added a streaming API. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-93"> - Eliminated the necessity of a content-length header. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-108" - due-to="Amichai Rothman" due-to-email="amich...@amichais.net"> - Eliminated the limitation of a maximum size for a single - header line. (The total size of all headers is already - limited, so there's no need for another limit.) - </action> - <action dev="jochen" type="add" issue="FILEUPLOAD-87"> - Added the ProgressListener, which allows to implement a - progress bar. - </action> - <action dev="jochen" type="add" issue="FILEUPLOAD-111" - due-to="Amichai Rothman" due-to-email="amich...@amichais.net"> - Added support for header continuation lines. - </action> - <action dev="jochen" type="add" issue="FILEUPLOAD-88" - due-to="Andrey Aristarkhov" due-to-email="aristark...@bitechnology.ru"> - It is now possible to limit the actual file size and not - the request size. - </action> - <action dev="jochen" type="add" issue="FILEUPLOAD-120" - due-to="Henry Yandell" due-to-email="bay...@apache.org"> - Added the FileCleanerCleanup as an example for how to close - down the FileCleaner's reaper thread nicely. - </action> - <action dev="jochen" type="fix" issue="FILEUPLOAD-123"> - A descriptive NPE is now thrown, if the FileItemFactory - has not been set. - </action> - </release> - - <release version="1.1.1" date="2006-06-08" description="Bugfix release"> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-20"> - Cache disk file item size when it is moved to a new location. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-30"> - File names were being inadvertently converted to lower case. - </action> - - </release> - - <release version="1.1" date="2005-12-24" description="Portlet support, substantial refactoring and numerous bug fixes"> - - <action dev="martinc" type="update"> - Updates for FileUpload 1.1-RC1. - </action> - - <action dev="martinc" type="add"> - Added release notes for FileUpload 1.1. - </action> - - <action dev="martinc" type="update"> - Update the User Guide to document the "right" way of using FileUpload - 1.1, rather than the older, and thus deprecated, ways that are - compatible with FileUpload 1.0. - </action> - - <action dev="martinc" type="add"> - Add this change log, including all changes since the Commons FileUpload - 1.0 release. - </action> - - <action dev="martinc" type="update"> - Update Commons IO dependency to version 1.1. - </action> - - <action dev="martinc" type="add"> - Add custom PMD configuration. - </action> - - <action dev="martinc" type="update"> - Make inner exception classes static, which they should have been all - along. - </action> - - <action dev="martinc" type="fix"> - Fix Checkstyle warnings. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-29" due-to="Rahul Akolkar"> - Remove Javadoc warnings. - </action> - - <action dev="martinc" type="update"> - Build updates: - (1) Include NOTICE.txt in the jar file and distributions. - (2) Include xdocs in source distribution. - (3) Create MD5 checksums for distributions. - </action> - - <action dev="martinc" type="add"> - Add custom Checkstyle configuration. - </action> - - <action dev="martinc" type="update"> - Update dependencies in POM, and add comments and scope. - </action> - - <action dev="martinc" type="update"> - Standardise on @throws instead of having a mixture of that and - @exception. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-50" due-to="Niall Pemberton"> - Make DiskFileItem serializable. Thanks to Niall Pemberton for the - suggestion and patch. - </action> - - <action dev="martinc" type="update"> - Make the temporary file names unique across class loaders, not just - within them, by including a UID in the file name. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-77"> - Include the actual and permitted sizes in both the exception message - and the exception itself. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-13"> - If an explicit header encoding is not specified, use the one from the - appropriate context (i.e. ServletRequest or ActionRequest). - </action> - - <action dev="martinc" type="add"> - Add getCharacterEncoding to the request context. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-83"> - Null check and case insensitivity fixes. - </action> - - <action dev="martinc" type="update"> - Web site updates: - (1) Add detail pages for Source Repository and Issue Tracking, based on - those for IO and Validator. - (2) Improvements to FileUpload home page, based on similar recent - changes to IO and Validator home pages. - (3) The Bugzilla component name has a space in it. Fix the URLs. - (4) Add an FAQ page, using the Maven plugin to generate it. - </action> - - <action dev="dion" type="fix" issue="COMMONSSITE-2"> - Fixes to POMs - </action> - - <action dev="mrdon" type="update"> - Setting source and target for Java 1.3 - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-37"> - Fix typos in Javadoc code examples. - </action> - - <action dev="martinc" type="fix"> - Fix typos in exception messages. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-5"> - Obtain request content type from container instead of headers. - </action> - - <action dev="sullis" type="update"> - New mock objects from Jetspeed-2, and new FileUpload test cases. - </action> - - <action dev="sullis" type="add"> - added toString() methods - </action> - - <action dev="martinc" type="add"> - Fix up the existing package.html file and add new ones for the newly - introduced packages. Fairly minimal, but with a link to the user guide. - </action> - - <action dev="martinc" type="update"> - Substantial refactoring and additions: - (1) The core package is now independent of servlet / portlet / other - distinctions, as well as persistence schemes, other than deprecated - classes and methods retained for backwards compatibility. - (2) Servlet specific functionality has been moved to a new 'servlet' - package. Existing users should migrate to this as soon as possible, - since the servlet specific functionality in the generic package - will be removed in the release after FileUpload 1.1. - (3) Support for portlets (JSR 168) has been added, in a new 'portlet' - package. This is not well tested at this point, and feedback would - be very much appreciated. (This also resolves bug #23620.) - (4) The disk-based file item implementation has been moved into a 'disk' - package, and renamed from Default* to Disk* to reflect what it - really is. The Default* classes have been retained in the top level - package for backwards compatibility, but are now deprecated, and - will be removed in the release after FileUpload 1.1. - (5) The isMultipartRequest method is an unfortunate casualty of this - refactoring. That method should really be moved to ServletFileUpload, - but since the method is static, it can only exist in either - FileUploadBase or ServletFileUpload. Backwards compatibility dictates - the former for now, but the latter is the desired state, which - implies some future breakage. Fair warning... - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-4"> - Specify the encoding (ISO-8859-1) when converting the boundary to a - byte array. - </action> - - <action dev="martinc" type="update"> - Convert to Sun coding guidelines. - </action> - - <action dev="martinc" type="update"> - DeferredFileOutputStream moved to Commons IO. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-16" due-to="Justin Sampson"> - Workaround for Mac IE5 bug. Thanks to Justin Sampson for the patch and - tests for this vexing issue. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-104"> - Handle unquoted header parameters. - </action> - - <action dev="martinc" type="add" issue="FILEUPLOAD-78"> - Some documentation on interaction with virus scanners. - </action> - - <action dev="martinc" type="add" issue="FILEUPLOAD-31" due-to="Justin Sampson"> - More unit tests from Justin Sampson. - </action> - - <action dev="martinc" type="update" issue="FILEUPLOAD-95"> - Use FileCleaner from Commons IO to clean up temp files, rather than - File.deleteOnExit(), which can cause serious problems in long-running - processes. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-53"> - Check that HTTP method is POST as part of multipart check. - </action> - - <action dev="martinc" type="add"> - Switch to Commons IO version of DeferredFileOutputStream. Adding IO as - a dependency will allow us to take advantage of other classes in that - component to fix additional FileUpload bugs. - </action> - - <action dev="martinc" type="add" issue="FILEUPLOAD-40"> - handle quoted boundary specification. - </action> - - <action dev="martinc" type="add" issue="FILEUPLOAD-18"> - use case-independent comparisons for encoding types. - </action> - - <action dev="martinc" type="fix"> - Fix comments to avoid break iterator complaints. - </action> - - <action dev="martinc" type="fix" due-to="Yuji Yamano"> - Fix typos in comments. - </action> - - <action dev="martinc" type="add" issue="FILEUPLOAD-101" due-to="Oleg Kalnichevski"> - Add support for character sets specified for individual parts. - </action> - - <action dev="scolebourne" type="update"> - Change to Apache License 2.0 - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-22"> - Correct the comment for the no-args constructor to reflect the fact - that a factory needs to be set before parsing uploads. - </action> - - <action dev="martinc" type="update"> - Collapse some all but duplicated code. - </action> - - <action dev="jmcnally" type="fix" issue="FILEUPLOAD-72"> - Fix example showing FileItem.write to use a File object. - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-21" due-to="Peter Chase"> - Check for null before attempting to close streams in write(). - </action> - - <action dev="martinc" type="fix" issue="FILEUPLOAD-67" due-to="Paul Dalton"> - Correction to sample code in the docs. - </action> - - </release> - - <release version="1.0" date="2003-06-26" description="Initial release"> - </release> - - - </body> - -</document> +<?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 used by the maven-changes-plugin to generate the release notes. +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 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 +property to the number of days since the last release. + + +The <action> type attribute can be add,update,fix,remove. +--> + +<document xmlns="http://maven.apache.org/changes/2.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/changes/2.0.0 https://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-2.0.0.xsd"> + <properties> + <title>Apache Commons FileUpload Release Notes</title> + <author email="d...@commons.apache.org">Apache Commons Developers</author> + </properties> + <body> + <release version="2.0.0" date="2024-MM-DD" description="2.0.0 Release, requires Java 11."> + <!-- FIX --> + <action type="fix" dev="ggregory" due-to="Gregor Dschung">[site] Fix instantiation of DiskFileItemFactory in migration guide #273.</action> + <action issue="FILEUPLOAD-355" type="fix" dev="ggregory" due-to="Ana, Gary Gregory">[site] Update code example: Use IOUtils instead of Streams utils class.</action> + <action type="fix" dev="ggregory" due-to="Gary Gregory">Replace internal use of Locale.ENGLISH with Locale.ROOT.</action> + <action type="fix" dev="ggregory" due-to="Gary Gregory">Pick up JUnit version from parent POM.</action> + <action issue="FILEUPLOAD-356" type="fix" dev="ggregory" due-to="Mattias Reichel, GirirajSinghRathore, Gary Gregory">[site] Fix incorrect link to changes report in Commons FileUpload #357.</action> + <action type="fix" dev="ggregory" due-to="Filipe Roque">Fix changes report link for new version of Maven Changes plugin from commons-parent 79 #388.</action> + <!-- ADD --> + <action dev="ggregory" type="add" due-to="mufasa1976, Gary Gregory">Handle multipart/related Requests without content-disposition header.</action> + <!-- UDPATE --> + <action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 66 to 79 #283, #294, #335, #343, #345, #351, #356, #360, #368.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons-io:commons-io from 2.16.0 to 2.18.0 #297, #352, #377.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.3 to 3.7.0 #319.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.codehaus.mojo:taglist-maven-plugin from 3.0.0 to 3.1.0 #327.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.17.0 #331, #338, #346.</action> + </release> + <release version="2.0.0-M2" date="2023-12-24" description="2.0.0-M2 Release, requires Java 11."> + <!-- FIX --> + <action dev="ggregory" type="fix" due-to="James Reeves">Fix off-by-one error when checking fileSizeMax in FileItemInputImpl #235.</action> + <action issue="FILEUPLOAD-352" dev="ggregory" type="fix" due-to="Björn Kautler, Gary Gregory">NullPointerException in DiskFileItem#toString.</action> + <action dev="ggregory" type="fix" due-to="Gary Gregory">Fail fast on null inputs to org.apache.commons.fileupload2.core.AbstractRequestContext.AbstractRequestContext(Function, LongSupplier, T).</action> + <action dev="ggregory" type="fix" due-to="Gary Gregory">Complete refactoring in JakartaServletRequestContext.</action> + <action dev="ggregory" type="fix" due-to="Gary Gregory">Fix "Implicit narrowing conversion in compound assignment" from https://github.com/apache/commons-fileupload/security/code-scanning/118.</action> + <action dev="ggregory" type="fix" due-to="Gary Gregory">Pick up Maven Moditect plugin version from parent POM.</action> + <!-- ADD --> + <action dev="ggregory" type="add" due-to="Gary Gregory">Refactor to support Jakarta Servlet 5 and 6.</action> + <action dev="ggregory" type="add" due-to="Michal H Siemaszko, Gary Gregory">Generate some OSGi metadata.</action> + <!-- UDPATE --> + <action dev="ggregory" type="update" due-to="Dependabot">Bump Java from 8 to 11.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons-parent from 58 to 65.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons-lang3 from 3.12.0 to 3.14.0.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons-io from 2.13.0 to 2.16.0 #291.</action> + </release> + <release version="2.0.0-M1" date="2023-07-14" description="2.0.0-M1 Release, requires Java 8."> + <!-- FIX --> + <action dev="jochen" type="fix">Changing Maven coordinates, and package name, due to binary incompatible changes.</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 issue="FILEUPLOAD-296" dev="jochen" type="fix" due-to="David Georg Reochelt">Performance gains by reusing an internal buffer.</action> + <action issue="FILEUPLOAD-274" dev="jochen" type="fix" due-to="Merbin J Anselm" due-to-email="merbinjans...@gmail.com">RFC 5987 compliance</action> + <action dev="ggregory" type="fix" due-to="Emmanuel Lécharny">Slight optim: resuse the index position instead of recomputing it #49.</action> + <action issue="FILEUPLOAD-340" dev="mgrigorov" type="fix">Make commons-fileupload2 a JPMS module by adding module-info.class.</action> + <action issue="FILEUPLOAD-341" dev="jochen" type="fix" due-to="Martin Grigorov">Move Exception classes out of the impl package.</action> + <action dev="ggregory" type="fix" due-to="Gary Gregory">Rework exceptions to use propagated exception causes (introduced in Java 1.4).</action> + <action dev="ggregory" type="fix" due-to="Gary Gregory">All custom exception extend FileUploadException.</action> + <action dev="ggregory" type="fix" due-to="Gary Gregory">All custom exceptions serialVersionUID value is now 2.</action> + <action issue="FILEUPLOAD-350" dev="ggregory" type="fix" due-to="Ernesto Reinaldo Barreiro">FileUploadByteCountLimitException ctor switches fileName and fieldName parameters #216.</action> + <action dev="ggregory" type="fix" due-to="step-security-bot, Gary Gregory">[StepSecurity] ci: Harden GitHub Actions #224.</action> + <!-- ADD --> + <action dev="ggregory" type="add" due-to="Gary Gregory">Add github/codeql-action from #144.</action> + <action dev="jochen" type="add">Add the package org.apache.fileupload2.jaksrvlt, for compliance with Jakarta Servlet API 5.0.</action> + <action dev="jochen" type="add">Making FileUploadException a subclass of IOException. (Mibor API simplification.)</action> + <action dev="markt" type="add">Add a configurable limit (disabled by default) for the number of files to upload per request.</action> + <!-- REMOVE --> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated constructors in MultipartStream.</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated RequestContext.getContentLength().</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated JakSrvltRequestContext.getContentLength().</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated PortletRequestContext.getContentLength().</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated ServletRequestContext.getContentLength().</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.MAX_HEADER_SIZE.</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.createItem(Map, boolean).</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.getFieldName(Map).</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.getFileName(Map).</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.getHeader(Map, String).</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Remove deprecated FileUploadBase.parseHeaders(String).</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Replace org.apache.commons.fileupload2.util.mime.Base64Decoder with java.util.Base64.</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Replace LimitedInputStream with BoundedInputStream.</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">FileItemHeadersImpl is no longer Serializable.</action> + <action dev="ggregory" type="remove" due-to="Gary Gregory">Reuse Java's InvalidPathException instead of the custom InvalidFileNameException.</action> + <!-- UPDATE --> + <action dev="ggregory" type="update" due-to="Dependabot, Gary Gregory">Bump actions/cache from 2.1.6 to 3.0.8 #128, #140.</action> + <action dev="ggregory" type="update" due-to="Dependabot, Gary Gregory">Bump actions/checkout from 2.3.4 to 3.0.2 #125.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory">Bump build actions/setup-java from 1.4.3 to 3.8.0 #142, #175, #180, #182.</action> + <action dev="jochen" type="update">Bump Java compiler level to 1.8.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory, Dependabot">Bump commons-io:commons-io 2.6 to 2.13.0, #104, #221.</action> + <action dev="ggregory" type="update" due-to="Dependabot">Bump junit-jupiter from 5.5.2 to 5.9.1 #31, #130, #156, #166.</action> + <action dev="ggregory" type="update" due-to="Dependabot">Bump maven-pmd-plugin from 3.13.0 to 3.19.0 #48, #162.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory">Bump commons.japicmp.version from 0.13.0 to 0.16.0.</action> + <action dev="ggregory" type="update" due-to="Dependabot">Bump spotbugs-maven-plugin from 4.2.3 to 4.7.3.0 #103, #133, #141, #146, #155, #163, #179.</action> + <action dev="jochen" type="update" due-to="Dependabot">Bump spotbugs from 4.2.3 to 4.7.3, ignore EI_EXPOSE_REP, and EI_EXPOSE_REP2, #152, #161, #174.</action> + <action dev="ggregory" type="update" due-to="Dependabot">Bump biz.aQute.bndlib from 6.0.0 to 6.4.0 #129, #181.</action> + <action dev="ggregory" type="update" due-to="Gary Gregory, Dependabot">Bump commons-parent from 52 to 58, #167, #183, #194.</action> + <action dev="ggregory" type="update" due-to="Dependabot">Bump maven-checkstyle-plugin from 3.1.2 to 3.2.0 #160.</action> + </release> + <release version="1.5" date="2023-02-01" description="1.5 Release"> + </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> + <action issue="FILEUPLOAD-252" dev="tn" type="fix">DiskFileItem#write() could lose original IO exception</action> + <action issue="FILEUPLOAD-258" dev="tn" type="fix">DiskFileItem#getStoreLocation() wrongly returned a File object for items stored in memory</action> + <action issue="FILEUPLOAD-242" dev="tn" type="fix">FileUploadBase - should not silently catch and ignore all Throwables</action> + <action issue="FILEUPLOAD-257" dev="tn" type="fix">Fix Javadoc 1.8.0 errors</action> + <action issue="FILEUPLOAD-234" dev="tn" type="fix">Fix section "Resource cleanup" of the user guide</action> + <action issue="FILEUPLOAD-237" dev="tn" type="fix">Fix streaming example: use FileItem.getInputStream() instead of openStream()</action> + <action issue="FILEUPLOAD-248" dev="ecki" type="fix">DiskFileItem might suppress critical IOExceptions on rename - use FileUtil.move instead</action> + <action issue="FILEUPLOAD-251" dev="sebb" type="fix">DiskFileItem#getTempFile() is broken</action> + <action issue="FILEUPLOAD-250" dev="sebb" type="fix">FileUploadBase - potential resource leak - InputStream not closed on exception</action> + <action issue="FILEUPLOAD-244" dev="sebb" type="fix">DiskFileItem.readObject fails to close FileInputStream</action> + <action issue="FILEUPLOAD-246" dev="sebb" type="update">FileUpload should use IOUtils.closeQuietly where relevant</action> + <action issue="FILEUPLOAD-245" dev="sebb" type="fix">DiskFileItem.get() may not fully read the data</action> + <action issue="FILEUPLOAD-243" dev="sebb" type="update" due-to="Ville Skyttä">Make some MultipartStream private fields final</action> + <action dev="ecki" type="add">Site: added security report</action> + <action type="fix" dev="markt" due-to="Felix Schumacher">Improve performance for large multi-part boundaries</action> + <action type="add" issue="FILEUPLOAD-286" dev="jochen" due-to="maxxedev" due-to-email="maxxe...@gmail.com">Added the default character set to the DiskFileItem.</action> + <action type="fix" issue="FILEUPLOAD-288" dev="jochen" due-to="fangwentong" due-to-email="fangwentong2...@gmail.com">Avoid using File.exists() on temporary files, if we know that the file has been created.</action> + <action type="add" dev="jochen" due-to="Pascal Schumacher">Added .travis.yml, to fix build issues on Github.</action> + </release> + + <release version="1.3.3" description="Bugfix release for 1.3.3" date="2017-06-13"> + <action issue="FILEUPLOAD-279" dev="jochen" type="fix"> + DiskDileItem can actually no longer be deserialized, unless a system property is set to true. + </action> + </release> + + <release version="1.3.2" description="Bugfix release for 1.3.1" date="2016.05-26"> + <action issue="FILEUPLOAD-272" dev="jochen" type="update"> + SECURITY - CVE-2016-3092. Performance Improvement in MultipartStream. + </action> + </release> + + <release version="1.3.2" description= +"This is a security and maintenance release that includes an important security +fix as well. Compared to 1.3.1, no other changes have been made." date="2014-02-07"> + <action dev="jochen" type="fix"> + SECURITY - CVE-2016-3092. Specially crafted input can trigger a DoS, if the + size of the MIME boundard is close to the size of the buffer in MultipartStream. + (Similar to CVE-2014-0050.) + </action> + </release> + <release version="1.3.1" description= +"This is a security and maintenance release that includes an important security +fix as well as a small number of bugfixes." date="2014-02-07"> + <action dev="markt" type="fix"> + SECURITY - CVE-2014-0050. Specially crafted input can trigger a DoS if the + buffer used by the MultipartStream is not big enough. When constructing + MultipartStream enforce the requirements for buffer size by throwing an + IllegalArgumentException if the requested buffer size is too small. This + prevents the DoS. + </action> + <action dev="markt" type="fix" due-to="Arun Babu Neelicattu" due-to-email="a...@redhat.com"> + When deserializing DiskFileItems ensure that the repository location, if + any, is a valid one. + </action> + <action dev="markt" type="fix"> + Correct example in usage documentation so it compiles. + </action> + </release> + + <release version="1.3" description="maintenance release, JDK1.5 update" date="2013-03-27"> + <!-- important notes --> + <action dev="markt" type="fix"> + SECURITY - CVE-2013-0248. Update the Javadoc and documentation to make + it clear that setting a repository is required for a secure + configuration if there are local, untrusted users. + </action> + <!-- Sub-task --> + <action issue="FILEUPLOAD-216" dev="simonetripodi" type="update"> + Update the project tree dirs according to default Maven conventions + </action> + <action issue="FILEUPLOAD-217" dev="simonetripodi" type="update"> + drop JDK1.3 support and update to Java5 + </action> + <action issue="FILEUPLOAD-218" dev="simonetripodi" type="update"> + Update version in POM + </action> + <action issue="FILEUPLOAD-219" dev="simonetripodi" type="update"> + upgrade tests to JUnit 4 + </action> + <action issue="FILEUPLOAD-220" dev="simonetripodi" type="update"> + replace package.html with package-info.java + </action> + <action issue="FILEUPLOAD-221" dev="simonetripodi" type="update"> + FileItemHeadersImpl can now use LinkedHashMap + </action> + <action issue="FILEUPLOAD-222" dev="simonetripodi" type="update"> + Mark @deprecated classes/methods with @Deprecated annotation + </action> + <action issue="FILEUPLOAD-233" dev="sebb" type="fix" due-to="Simone Tripodi"> + Base64Decoder doesn't correctly implement RFC 4648 + </action> + <!-- Bug --> + <action issue="FILEUPLOAD-143" dev="jochen" type="fix" due-to="Luke Scott"> + "Stream ended unexpectedly" when posting from a Flash client + </action> + <action issue="FILEUPLOAD-173" dev="simonetripodi" type="fix" due-to="Bjorn Harvold"> + Manifest for OSGi has invalid syntax + </action> + <action issue="FILEUPLOAD-183" dev="simonetripodi" type="fix" due-to="Roman Arkadijovych Muntyanu"> + commons-io dependency does not get loaded by maven if only dependency to commons-fileupload is specified + </action> + <action issue="FILEUPLOAD-185" dev="simonetripodi" type="fix" due-to="Sebb"> + https://commons.apache.org/fileupload/index.html is out of date + </action> + <action issue="FILEUPLOAD-186" dev="simonetripodi" type="fix" due-to="Sebb"> + https://commons.apache.org/fileupload/index.html should not mention nightly builds + </action> + <action issue="FILEUPLOAD-189" dev="simonetripodi" type="fix" due-to="Gregor K"> + DiskFileItemFactory use of FileCleaningTracker is documented or coded wrong - proposal submitted by Jan Novotný + </action> + <action issue="FILEUPLOAD-195" dev="simonetripodi" type="fix" due-to="Juliano Alves"> + Error reading the file size larger than 2 gb - pull request from Gergely + </action> + <action issue="FILEUPLOAD-197" dev="simonetripodi" type="fix" due-to="David Wolverton"> + ServletFileUpload isMultipartContent method does not support HTTP PUT - thanks Roy T. Fielding and Jochen Wiedmann + </action> + <action issue="FILEUPLOAD-199" dev="simonetripodi" type="fix" due-to="Mark Thomas"> + Uploads have unexpected results for files with non-ASCII names - support RFC2047 - thanks Thomas Neidhart + </action> + <action issue="FILEUPLOAD-202" dev="tn" type="fix" due-to="tina"> + Exceptions resulting from upload size limitations (fileSizeMax, sizeMax) + are now correctly propagated to the caller (these could be encountered + formerly as MalformedStreamException: "Stream ended unexpectedly"). + </action> + <action issue="FILEUPLOAD-204" dev="jochen" type="fix" due-to="Hakju Oh"> + FileItem.getHeaders() returns always null. + </action> + <action issue="FILEUPLOAD-212" dev="tn" type="fix" due-to="Damian Kolasa"> + The sizeMax parameter within FileUpload is now correctly enforced if + no content length header is provided. + </action> + <action issue="FILEUPLOAD-214" dev="simonetripodi" type="fix" due-to="Matthew Runo"> + ServletFileUpload only accepts POST requests + </action> + <action issue="FILEUPLOAD-228" dev="simonetripodi" type="fix" due-to="Thomas Neidhart"> + (Servlet|Portlet)RequestContext#contentLength() must return request.getContentLength() if Content-length header is not available + </action> + <action issue="FILEUPLOAD-229" dev="simonetripodi" type="fix" due-to="seb"> + toLowerCase() is Locale-dependent; should use toLowerCase(Locale.ENGLISH) instead + </action> + <action issue="FILEUPLOAD-229" dev="sebb,simonetripodi" type="fix" due-to="seb"> + There are no unit tests for the new utils.mime classes + </action> + <!-- Improvement --> + <action issue="FILEUPLOAD-182" dev="simonetripodi" type="add" due-to="Chris Lott"> + Documentation: add simple HTML form example to fileupload user guide + </action> + <action issue="FILEUPLOAD-207" dev="simonetripodi" type="add" due-to="frank"> + enhance file read/write performance - patch provided by frank + </action> + <action issue="FILEUPLOAD-209" dev="simonetripodi" type="add" due-to="Fernando Ribeiro"> + Add Support for Generic Types + </action> + <action issue="FILEUPLOAD-210" dev="simonetripodi" type="add" due-to="Fernando Ribeiro"> + Process HTTP Requests Into Maps + </action> + <action issue="FILEUPLOAD-223" dev="simonetripodi" type="update" due-to=""> + Update commons-io dependency to latest version that supports JDK1.5 + </action> + <action issue="FILEUPLOAD-224" dev="simonetripodi" type="update"> + Avoid string concatenations while parsing headers, use buffers instead + </action> + <action issue="FILEUPLOAD-225" dev="simonetripodi" type="update"> + Replace java.rmi.server.UID() with java.util.UUID + </action> + <action issue="FILEUPLOAD-226" dev="sebb" type="update"> + DiskFileItem.counter could be converted to AtomicInteger (or AtomicLong?) + </action> + <action issue="FILEUPLOAD-227" dev="sebb" type="update"> + Private immutable fields which could be final + </action> + <!-- Task --> + <action issue="FILEUPLOAD-201" dev="simonetripodi" type="update"> + Update to JDK 1.5 and bump IO dependency to 2.0.1 + </action> + <action issue="FILEUPLOAD-215" dev="simonetripodi" type="update"> + version 1.3 improvement tasks + </action> + </release> + + <release version="1.2.2" date="2010-07-29"> + <action dev="jochen" type="fix" + due-to="Daniel Fabian" due-to-email="dfab...@google.com"> + Added a check for file names containing a NULL characters. Such file + names are now triggering an InvalidFileNameException since the file name + cannot be used as provided to create the file since it will be truncated + at the NUL character on most (all?) operating systems. E.g. a file name + like "test.foo0.bar" would result in "test.foo" being created. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-160" + due-to="Stepan Koltsov" due-to-email="y...@mx1.ru"> + Temporary files have not been deleted, if an error + occurred in FileUploadBase.parseRequest(); + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-158" + due-to="Stepan Koltsov" due-to-email="y...@mx1.ru"> + Fixed example in MultipartStream Javadocs. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-157" + due-to="Paul Spurr" due-to-email="psp...@gmail.com"> + Ensured, that the ProgressListener is called for all + items. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-156"> + Made the ProgressNotifier public. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-155" + due-to="Jörg Heinicke" due-to-email="joerg.heini...@gmx.de"> + Multiple documentation fixes. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-152" + due-to="Duzakropka" due-to-email="duzakrop...@gmail.com"> + Fixed the error message for FileSizeLimitExceededException + from "too many characters" to "too many bytes". + </action> + <action dev="jochen" type="add" issue="FILEUPLOAD-154"> + A FileSizeLimitExceededException does now contain the + file and field name of the item, which caused the problem. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-130" + due-to="Guillaume Cottenceau" due-to-email="cott...@gmail.com"> + The FileItemHeader stuff hasn't been actually working. + </action> + </release> + + <release version="1.2.1" date="2008-01-18"> + <action dev="jochen" type="fix"> + Upgrade to commons-io-1.4-SNAPSHOT, in order to use the new + FileCleaningTracker and fix issues with FileCleaner. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-129"> + Made the MockHttpServletRequest comply to the servlet 2.4 specification + by applying + http://www.sourcelabs.com/dashboards/sash-1.2/patches/commons-fileupload-1.1-1/SUP-520.diff + </action> + <action dev="jochen" type="add" issue="FILEUPLOAD-130" + due-to="Michael Macaluso" due-to-email="michael.pub...@wavecorp.com"> + Added support for accessing the file item headers. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-116" + due-to="Amichai Rothman" due-to-email="amich...@amichais.net"> + A MalformedStreamException is now thrown, if the size of an items + headers exceeds HEADER_PART_SIZE_MAX; + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-134" + due-to="Thomas Vandahl" due-to-email="t...@apache.org"> + DiskFileItem.toString() could throw an NPE. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-135" + due-to="Alexander Sova" due-to-email="b...@noir.crocodile.org"> + Short files could cause an unexpected end of the item stream. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-145"> + A FileSizeLimitExceededException was deferred until the complete + file has been uploaded. Additionally, the FileSizeLimitException + is now thrown immediately, if the attachments headers contain + a content-length value, which exceeds the configured limit. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-153" + due-to="Gary Gregory" due-to-email="ggreg...@seagullsw.com"> + Fixed a classpath problem when building with Sun JDK 1.3.1 + and Ant. + </action> + </release> + + <release version="1.2" date="2007-02-13"> + <action dev="jochen" type="fix" due-to="Aaron Freeman" + due-to-email="aa...@sendthisfile.com"> + Made Streams.asString static. + </action> + <action dev="jochen" type="update" issue="FILEUPLOAD-109"> + Eliminated duplicate code. + </action> + <action dev="jochen" type="add" issue="FILEUPLOAD-112"> + Added a streaming API. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-93"> + Eliminated the necessity of a content-length header. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-108" + due-to="Amichai Rothman" due-to-email="amich...@amichais.net"> + Eliminated the limitation of a maximum size for a single + header line. (The total size of all headers is already + limited, so there's no need for another limit.) + </action> + <action dev="jochen" type="add" issue="FILEUPLOAD-87"> + Added the ProgressListener, which allows to implement a + progress bar. + </action> + <action dev="jochen" type="add" issue="FILEUPLOAD-111" + due-to="Amichai Rothman" due-to-email="amich...@amichais.net"> + Added support for header continuation lines. + </action> + <action dev="jochen" type="add" issue="FILEUPLOAD-88" + due-to="Andrey Aristarkhov" due-to-email="aristark...@bitechnology.ru"> + It is now possible to limit the actual file size and not + the request size. + </action> + <action dev="jochen" type="add" issue="FILEUPLOAD-120" + due-to="Henry Yandell" due-to-email="bay...@apache.org"> + Added the FileCleanerCleanup as an example for how to close + down the FileCleaner's reaper thread nicely. + </action> + <action dev="jochen" type="fix" issue="FILEUPLOAD-123"> + A descriptive NPE is now thrown, if the FileItemFactory + has not been set. + </action> + </release> + + <release version="1.1.1" date="2006-06-08" description="Bugfix release"> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-20"> + Cache disk file item size when it is moved to a new location. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-30"> + File names were being inadvertently converted to lower case. + </action> + + </release> + + <release version="1.1" date="2005-12-24" description="Portlet support, substantial refactoring and numerous bug fixes"> + + <action dev="martinc" type="update"> + Updates for FileUpload 1.1-RC1. + </action> + + <action dev="martinc" type="add"> + Added release notes for FileUpload 1.1. + </action> + + <action dev="martinc" type="update"> + Update the User Guide to document the "right" way of using FileUpload + 1.1, rather than the older, and thus deprecated, ways that are + compatible with FileUpload 1.0. + </action> + + <action dev="martinc" type="add"> + Add this change log, including all changes since the Commons FileUpload + 1.0 release. + </action> + + <action dev="martinc" type="update"> + Update Commons IO dependency to version 1.1. + </action> + + <action dev="martinc" type="add"> + Add custom PMD configuration. + </action> + + <action dev="martinc" type="update"> + Make inner exception classes static, which they should have been all + along. + </action> + + <action dev="martinc" type="fix"> + Fix Checkstyle warnings. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-29" due-to="Rahul Akolkar"> + Remove Javadoc warnings. + </action> + + <action dev="martinc" type="update"> + Build updates: + (1) Include NOTICE.txt in the jar file and distributions. + (2) Include xdocs in source distribution. + (3) Create MD5 checksums for distributions. + </action> + + <action dev="martinc" type="add"> + Add custom Checkstyle configuration. + </action> + + <action dev="martinc" type="update"> + Update dependencies in POM, and add comments and scope. + </action> + + <action dev="martinc" type="update"> + Standardise on @throws instead of having a mixture of that and + @exception. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-50" due-to="Niall Pemberton"> + Make DiskFileItem serializable. Thanks to Niall Pemberton for the + suggestion and patch. + </action> + + <action dev="martinc" type="update"> + Make the temporary file names unique across class loaders, not just + within them, by including a UID in the file name. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-77"> + Include the actual and permitted sizes in both the exception message + and the exception itself. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-13"> + If an explicit header encoding is not specified, use the one from the + appropriate context (i.e. ServletRequest or ActionRequest). + </action> + + <action dev="martinc" type="add"> + Add getCharacterEncoding to the request context. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-83"> + Null check and case insensitivity fixes. + </action> + + <action dev="martinc" type="update"> + Web site updates: + (1) Add detail pages for Source Repository and Issue Tracking, based on + those for IO and Validator. + (2) Improvements to FileUpload home page, based on similar recent + changes to IO and Validator home pages. + (3) The Bugzilla component name has a space in it. Fix the URLs. + (4) Add an FAQ page, using the Maven plugin to generate it. + </action> + + <action dev="dion" type="fix" issue="COMMONSSITE-2"> + Fixes to POMs + </action> + + <action dev="mrdon" type="update"> + Setting source and target for Java 1.3 + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-37"> + Fix typos in Javadoc code examples. + </action> + + <action dev="martinc" type="fix"> + Fix typos in exception messages. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-5"> + Obtain request content type from container instead of headers. + </action> + + <action dev="sullis" type="update"> + New mock objects from Jetspeed-2, and new FileUpload test cases. + </action> + + <action dev="sullis" type="add"> + added toString() methods + </action> + + <action dev="martinc" type="add"> + Fix up the existing package.html file and add new ones for the newly + introduced packages. Fairly minimal, but with a link to the user guide. + </action> + + <action dev="martinc" type="update"> + Substantial refactoring and additions: + (1) The core package is now independent of servlet / portlet / other + distinctions, as well as persistence schemes, other than deprecated + classes and methods retained for backwards compatibility. + (2) Servlet specific functionality has been moved to a new 'servlet' + package. Existing users should migrate to this as soon as possible, + since the servlet specific functionality in the generic package + will be removed in the release after FileUpload 1.1. + (3) Support for portlets (JSR 168) has been added, in a new 'portlet' + package. This is not well tested at this point, and feedback would + be very much appreciated. (This also resolves bug #23620.) + (4) The disk-based file item implementation has been moved into a 'disk' + package, and renamed from Default* to Disk* to reflect what it + really is. The Default* classes have been retained in the top level + package for backwards compatibility, but are now deprecated, and + will be removed in the release after FileUpload 1.1. + (5) The isMultipartRequest method is an unfortunate casualty of this + refactoring. That method should really be moved to ServletFileUpload, + but since the method is static, it can only exist in either + FileUploadBase or ServletFileUpload. Backwards compatibility dictates + the former for now, but the latter is the desired state, which + implies some future breakage. Fair warning... + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-4"> + Specify the encoding (ISO-8859-1) when converting the boundary to a + byte array. + </action> + + <action dev="martinc" type="update"> + Convert to Sun coding guidelines. + </action> + + <action dev="martinc" type="update"> + DeferredFileOutputStream moved to Commons IO. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-16" due-to="Justin Sampson"> + Workaround for Mac IE5 bug. Thanks to Justin Sampson for the patch and + tests for this vexing issue. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-104"> + Handle unquoted header parameters. + </action> + + <action dev="martinc" type="add" issue="FILEUPLOAD-78"> + Some documentation on interaction with virus scanners. + </action> + + <action dev="martinc" type="add" issue="FILEUPLOAD-31" due-to="Justin Sampson"> + More unit tests from Justin Sampson. + </action> + + <action dev="martinc" type="update" issue="FILEUPLOAD-95"> + Use FileCleaner from Commons IO to clean up temp files, rather than + File.deleteOnExit(), which can cause serious problems in long-running + processes. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-53"> + Check that HTTP method is POST as part of multipart check. + </action> + + <action dev="martinc" type="add"> + Switch to Commons IO version of DeferredFileOutputStream. Adding IO as + a dependency will allow us to take advantage of other classes in that + component to fix additional FileUpload bugs. + </action> + + <action dev="martinc" type="add" issue="FILEUPLOAD-40"> + handle quoted boundary specification. + </action> + + <action dev="martinc" type="add" issue="FILEUPLOAD-18"> + use case-independent comparisons for encoding types. + </action> + + <action dev="martinc" type="fix"> + Fix comments to avoid break iterator complaints. + </action> + + <action dev="martinc" type="fix" due-to="Yuji Yamano"> + Fix typos in comments. + </action> + + <action dev="martinc" type="add" issue="FILEUPLOAD-101" due-to="Oleg Kalnichevski"> + Add support for character sets specified for individual parts. + </action> + + <action dev="scolebourne" type="update"> + Change to Apache License 2.0 + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-22"> + Correct the comment for the no-args constructor to reflect the fact + that a factory needs to be set before parsing uploads. + </action> + + <action dev="martinc" type="update"> + Collapse some all but duplicated code. + </action> + + <action dev="jmcnally" type="fix" issue="FILEUPLOAD-72"> + Fix example showing FileItem.write to use a File object. + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-21" due-to="Peter Chase"> + Check for null before attempting to close streams in write(). + </action> + + <action dev="martinc" type="fix" issue="FILEUPLOAD-67" due-to="Paul Dalton"> + Correction to sample code in the docs. + </action> + + </release> + + <release version="1.0" date="2003-06-26" description="Initial release"> + </release> + + + </body> + +</document> diff --git a/src/site/apt/migration.apt.vm b/src/site/apt/migration.apt.vm index f6c1a7bf..ac604cf2 100644 --- a/src/site/apt/migration.apt.vm +++ b/src/site/apt/migration.apt.vm @@ -1,180 +1,180 @@ -~~ -~~ 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. -~~ - --------- - Migrating - --------- - -Migrating - - This document provides advice for migration between versions of Commons FileUpload, and between versions - of the underlying Servlet API. - -* Migrating to Commons FileUpload 2 - - Commons FileUpload 2 breaks binary and source compatibility with version 1. - - To use version 2, you must to update your projects as follows: - - [[1]] Use Java 8 or above. - - [[2]] Add one or more these dependencies with the <<<groupId>>> <<org.apache.commons>>, and set the <<<artifactId>>> to: - - [[A]] <<commons-fileupload2-jakarta-serverl5>> to use Jakarta Servlets 5. - - [[B]] <<commons-fileupload2-jakarta-serverl6>> to use Jakarta Servlets 6. - - [[C]] <<commons-fileupload2-javax>> to use Javax Servlets. - - [[D]] <<commons-fileupload2-portlet>> to use Javax Portlets. - - [[E]] All of the above automatically depends on <<commons-fileupload2-core>>. - - [[3]] The dependency version is <<${project.version}>> - - [[4]] Change your imports from the root <<org.apache.commons.fileupload>> to <<org.apache.commons.fileupload2>>. - - For example, change: - -+------------------------------------------- - import org.apache.commons.fileupload.servlet.ServletFileUpload; -+------------------------------------------- - - to: - -+------------------------------------------- - import org.apache.commons.fileupload2.jakarta.servlet5.JakartaServletFileUpload; -+------------------------------------------- - - or: - -+------------------------------------------- - import org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileUpload; -+------------------------------------------- - - or: - -+------------------------------------------- - import org.apache.commons.fileupload2.javax.JavaxServletFileUpload; -+------------------------------------------- - - [[4]] Change some catch clauses, for example: - -+------------------------------------------- - try { - // Parse a FileUpload request here. - } catch (IOException e) { - // Handle the IOException - } catch (FileUploadException e) { - // Handle the FileUploadException - } -+------------------------------------------- - - In FileUpload 2, this is invalid because <<<FileUploadException>>> is a - subclass of <<<IOException>>>. To address this, switch the catch order, - and handle the <<<FileUploadException>>> in the first catch, and the <<<IOException>>> - in the second. - -* Migrating to Jakarta Servlet API, Version 5, or later. - - Most existing projects Commons FileUpload 1 are based on the Javax Servlet API version - 2 or later. In Jakarta EE 9, this is replaced with the Jakarta Servlet API version 5. - - User code should now import the <<jakarta.servlet>> package instead of - the <<javax.servlet>> package. - - For applications using Commons FileUpload, this means, that you need to - - [[1]] Upgrade Commons FileUpload to version 2, or later. - - [[2]] Replace the classes from <<org.apache.commons.fileupload.servlet>> to either - <<org.apache.commons.fileupload2.jakarta>> or <<org.apache.commons.fileupload2.javax>>. - -*------------------------------------------------------------- *------------------------------------------------------------------------------* -| <<Version 1 Name>> | <<Version 2 Jakarta Servlet 5 Name>> | -*------------------------------------------------------------- *------------------------------------------------------------------------------* -| org.apache.commons.fileupload.servlet.ServletFileUpload | org.apache.commons.fileupload2.jakarta.servlet5.JakartaServletFileUpload | -*------------------------------------------------------------- *------------------------------------------------------------------------------* -| org.apache.commons.fileupload.servlet.ServletRequestContext | org.apache.commons.fileupload2.jakarta.servlet5.JakartaServletRequestContext | -*--------------------------------------------------------------*------------------------------------------------------------------------------* -| org.apache.commons.fileupload2.servlet.FileCleanerCleanup | org.apache.commons.fileupload2.jakarta.servlet5.JakartaServletFileCleaner | -*--------------------------------------------------------------*------------------------------------------------------------------------------* - -*------------------------------------------------------------- *------------------------------------------------------------------------------* -| <<Version 1 Name>> | <<Version 2 Jakarta Servlet 6 Name>> | -*------------------------------------------------------------- *------------------------------------------------------------------------------* -| org.apache.commons.fileupload.servlet.ServletFileUpload | org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileUpload | -*------------------------------------------------------------- *------------------------------------------------------------------------------* -| org.apache.commons.fileupload.servlet.ServletRequestContext | org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletRequestContext | -*--------------------------------------------------------------*------------------------------------------------------------------------------* -| org.apache.commons.fileupload2.servlet.FileCleanerCleanup | org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileCleaner | -*--------------------------------------------------------------*------------------------------------------------------------------------------* - -*------------------------------------------------------------- *---------------------------------------------------------------------* -| <<Version 1 Name>> | <<Version 2 Javax Name>> | -*------------------------------------------------------------- *---------------------------------------------------------------------* -| org.apache.commons.fileupload.servlet.ServletFileUpload | org.apache.commons.fileupload2.javax.JavaxServletFileUpload | -*------------------------------------------------------------- *---------------------------------------------------------------------* -| org.apache.commons.fileupload.servlet.ServletRequestContext | org.apache.commons.fileupload2.javax.JavaxServletRequestContext | -*--------------------------------------------------------------*---------------------------------------------------------------------* -| org.apache.commons.fileupload2.servlet.FileCleanerCleanup | org.apache.commons.fileupload2.javax.JavaxServletFileCleaner | -*--------------------------------------------------------------*---------------------------------------------------------------------* - -* Example - - The following example demonstrates, how to use Commons FileUpload with the Jakarta Servlet API, version 6: - -+------------------------------------------- - import java.io.IOException; - import java.util.List; - - import org.apache.commons.fileupload2.FileItem; - import org.apache.commons.fileupload2.FileItemFactory; - import org.apache.commons.fileupload2.FileUpload; - import org.apache.commons.fileupload2.FileUploadException; - import org.apache.commons.fileupload2.DiskFileItemFactory; - import org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileUpload; - import org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletRequestContext; - - import jakarta.servlet.ServletException; - import jakarta.servlet.http.HttpServlet; - import jakarta.servlet.http.HttpServletRequest; - import jakarta.servlet.http.HttpServletResponse; - - public class SampleServlet extends HttpServlet { - private static final long serialVersionUID = 2; - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - if (JakartaServletFileUpload.isMultipartContent(req)) { - final DiskFileItemFactory fileItemfactory = DiskFileItemFactory.builder().get(); - final JakartaServletFileUpload fileUpload = new JakartaServletFileUpload(fileItemfactory); - final List<FileItem> items; - try { - items = fileUpload.parseRequest(new JavaxServletRequestContext(req)); - } catch (FileUploadException e) { - throw new ServletException(e); - } - // Process the uploaded file items here... - } - } - } - -+------------------------------------------- - -* Using Commons FileUpload 2 as a JPMS Module - - The library provides <<META-INF/versions/module-info.class>> that defines the required modules and exported packages. +~~ +~~ 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. +~~ + --------- + Migrating + --------- + +Migrating + + This document provides advice for migration between versions of Commons FileUpload, and between versions + of the underlying Servlet API. + +* Migrating to Commons FileUpload 2 + + Commons FileUpload 2 breaks binary and source compatibility with version 1. + + To use version 2, you must to update your projects as follows: + + [[1]] Use Java 8 or above. + + [[2]] Add one or more these dependencies with the <<<groupId>>> <<org.apache.commons>>, and set the <<<artifactId>>> to: + + [[A]] <<commons-fileupload2-jakarta-serverl5>> to use Jakarta Servlets 5. + + [[B]] <<commons-fileupload2-jakarta-serverl6>> to use Jakarta Servlets 6. + + [[C]] <<commons-fileupload2-javax>> to use Javax Servlets. + + [[D]] <<commons-fileupload2-portlet>> to use Javax Portlets. + + [[E]] All of the above automatically depends on <<commons-fileupload2-core>>. + + [[3]] The dependency version is <<${project.version}>> + + [[4]] Change your imports from the root <<org.apache.commons.fileupload>> to <<org.apache.commons.fileupload2>>. + + For example, change: + ++------------------------------------------- + import org.apache.commons.fileupload.servlet.ServletFileUpload; ++------------------------------------------- + + to: + ++------------------------------------------- + import org.apache.commons.fileupload2.jakarta.servlet5.JakartaServletFileUpload; ++------------------------------------------- + + or: + ++------------------------------------------- + import org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileUpload; ++------------------------------------------- + + or: + ++------------------------------------------- + import org.apache.commons.fileupload2.javax.JavaxServletFileUpload; ++------------------------------------------- + + [[4]] Change some catch clauses, for example: + ++------------------------------------------- + try { + // Parse a FileUpload request here. + } catch (IOException e) { + // Handle the IOException + } catch (FileUploadException e) { + // Handle the FileUploadException + } ++------------------------------------------- + + In FileUpload 2, this is invalid because <<<FileUploadException>>> is a + subclass of <<<IOException>>>. To address this, switch the catch order, + and handle the <<<FileUploadException>>> in the first catch, and the <<<IOException>>> + in the second. + +* Migrating to Jakarta Servlet API, Version 5, or later. + + Most existing projects Commons FileUpload 1 are based on the Javax Servlet API version + 2 or later. In Jakarta EE 9, this is replaced with the Jakarta Servlet API version 5. + + User code should now import the <<jakarta.servlet>> package instead of + the <<javax.servlet>> package. + + For applications using Commons FileUpload, this means, that you need to + + [[1]] Upgrade Commons FileUpload to version 2, or later. + + [[2]] Replace the classes from <<org.apache.commons.fileupload.servlet>> to either + <<org.apache.commons.fileupload2.jakarta>> or <<org.apache.commons.fileupload2.javax>>. + +*------------------------------------------------------------- *------------------------------------------------------------------------------* +| <<Version 1 Name>> | <<Version 2 Jakarta Servlet 5 Name>> | +*------------------------------------------------------------- *------------------------------------------------------------------------------* +| org.apache.commons.fileupload.servlet.ServletFileUpload | org.apache.commons.fileupload2.jakarta.servlet5.JakartaServletFileUpload | +*------------------------------------------------------------- *------------------------------------------------------------------------------* +| org.apache.commons.fileupload.servlet.ServletRequestContext | org.apache.commons.fileupload2.jakarta.servlet5.JakartaServletRequestContext | +*--------------------------------------------------------------*------------------------------------------------------------------------------* +| org.apache.commons.fileupload2.servlet.FileCleanerCleanup | org.apache.commons.fileupload2.jakarta.servlet5.JakartaServletFileCleaner | +*--------------------------------------------------------------*------------------------------------------------------------------------------* + +*------------------------------------------------------------- *------------------------------------------------------------------------------* +| <<Version 1 Name>> | <<Version 2 Jakarta Servlet 6 Name>> | +*------------------------------------------------------------- *------------------------------------------------------------------------------* +| org.apache.commons.fileupload.servlet.ServletFileUpload | org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileUpload | +*------------------------------------------------------------- *------------------------------------------------------------------------------* +| org.apache.commons.fileupload.servlet.ServletRequestContext | org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletRequestContext | +*--------------------------------------------------------------*------------------------------------------------------------------------------* +| org.apache.commons.fileupload2.servlet.FileCleanerCleanup | org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileCleaner | +*--------------------------------------------------------------*------------------------------------------------------------------------------* + +*------------------------------------------------------------- *---------------------------------------------------------------------* +| <<Version 1 Name>> | <<Version 2 Javax Name>> | +*------------------------------------------------------------- *---------------------------------------------------------------------* +| org.apache.commons.fileupload.servlet.ServletFileUpload | org.apache.commons.fileupload2.javax.JavaxServletFileUpload | +*------------------------------------------------------------- *---------------------------------------------------------------------* +| org.apache.commons.fileupload.servlet.ServletRequestContext | org.apache.commons.fileupload2.javax.JavaxServletRequestContext | +*--------------------------------------------------------------*---------------------------------------------------------------------* +| org.apache.commons.fileupload2.servlet.FileCleanerCleanup | org.apache.commons.fileupload2.javax.JavaxServletFileCleaner | +*--------------------------------------------------------------*---------------------------------------------------------------------* + +* Example + + The following example demonstrates, how to use Commons FileUpload with the Jakarta Servlet API, version 6: + ++------------------------------------------- + import java.io.IOException; + import java.util.List; + + import org.apache.commons.fileupload2.FileItem; + import org.apache.commons.fileupload2.FileItemFactory; + import org.apache.commons.fileupload2.FileUpload; + import org.apache.commons.fileupload2.FileUploadException; + import org.apache.commons.fileupload2.DiskFileItemFactory; + import org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletFileUpload; + import org.apache.commons.fileupload2.jakarta.servlet6.JakartaServletRequestContext; + + import jakarta.servlet.ServletException; + import jakarta.servlet.http.HttpServlet; + import jakarta.servlet.http.HttpServletRequest; + import jakarta.servlet.http.HttpServletResponse; + + public class SampleServlet extends HttpServlet { + private static final long serialVersionUID = 2; + + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + if (JakartaServletFileUpload.isMultipartContent(req)) { + final DiskFileItemFactory fileItemfactory = DiskFileItemFactory.builder().get(); + final JakartaServletFileUpload fileUpload = new JakartaServletFileUpload(fileItemfactory); + final List<FileItem> items; + try { + items = fileUpload.parseRequest(new JavaxServletRequestContext(req)); + } catch (FileUploadException e) { + throw new ServletException(e); + } + // Process the uploaded file items here... + } + } + } + ++------------------------------------------- + +* Using Commons FileUpload 2 as a JPMS Module + + The library provides <<META-INF/versions/module-info.class>> that defines the required modules and exported packages.