Author: markt
Date: Tue Jan 29 14:24:18 2019
New Revision: 1852457
URL: http://svn.apache.org/viewvc?rev=1852457&view=rev
Log:
Update the internal fork of Apache Commons FileUpload to pick up the changes in
the Apache Commons FileUpload 1.4 release.
Modified:
tomcat/trunk/MERGE.txt
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/IOUtils.java
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/MERGE.txt
URL:
http://svn.apache.org/viewvc/tomcat/trunk/MERGE.txt?rev=1852457&r1=1852456&r2=1852457&view=diff
==============================================================================
--- tomcat/trunk/MERGE.txt (original)
+++ tomcat/trunk/MERGE.txt Tue Jan 29 14:24:18 2019
@@ -55,9 +55,9 @@ the patch file has been applied and comm
FileUpload
----------
Sub-tree:
-src/main/java/org/apache/commons/fileupload
+src/main/java/org/apache/commons/fileupload2
The SHA1 ID for the most recent commit to be merged to Tomcat is:
-b1498c9877d751f8bc4635a6f252ebdfcba28518
+2cf7d09fefb17c59e5a776fd6850aebdf41046b2
Note: Tomcat's copy of fileupload also includes classes copied manually (rather
than svn copied) from Commons IO.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1852457&r1=1852456&r2=1852457&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
Tue Jan 29 14:24:18 2019
@@ -606,20 +606,23 @@ public abstract class FileUploadBase {
fieldName = pFieldName;
contentType = pContentType;
formField = pFormField;
- final ItemInputStream itemStream = multi.newInputStream();
- InputStream istream = itemStream;
- if (fileSizeMax != -1) {
+ if (fileSizeMax != -1) { // Check if limit is already exceeded
if (pContentLength != -1
- && pContentLength > fileSizeMax) {
+ && pContentLength > fileSizeMax) {
FileSizeLimitExceededException e =
- new FileSizeLimitExceededException(
- String.format("The field %s exceeds its
maximum permitted size of %s bytes.",
- fieldName, Long.valueOf(fileSizeMax)),
- pContentLength, fileSizeMax);
+ new FileSizeLimitExceededException(
+ String.format("The field %s exceeds
its maximum permitted size of %s bytes.",
+ fieldName,
Long.valueOf(fileSizeMax)),
+ pContentLength, fileSizeMax);
e.setFileName(pName);
e.setFieldName(pFieldName);
throw new FileUploadIOException(e);
}
+ }
+ // OK to construct stream now
+ final ItemInputStream itemStream = multi.newInputStream();
+ InputStream istream = itemStream;
+ if (fileSizeMax != -1) {
istream = new LimitedInputStream(istream, fileSizeMax) {
@Override
protected void raiseError(long pSizeMax, long pCount)
Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/IOUtils.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/IOUtils.java?rev=1852457&r1=1852456&r2=1852457&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/IOUtils.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/IOUtils.java Tue
Jan 29 14:24:18 2019
@@ -58,7 +58,12 @@ public class IOUtils {
// Writer. Each method should take at least one of these as a parameter,
// or return one of them.
- private static final int EOF = -1;
+ /**
+ * Represents the end-of-file (or stream).
+ * @since 2.5 (made public)
+ */
+ public static final int EOF = -1;
+
/**
* The default buffer size ({@value}) to use for
@@ -67,13 +72,6 @@ public class IOUtils {
private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
/**
- * Instances should NOT be constructed in standard programming.
- */
- public IOUtils() {
- super();
- }
-
- /**
* Closes a <code>Closeable</code> unconditionally.
* <p>
* Equivalent to {@link Closeable#close()}, except any exceptions will be
ignored. This is typically used in
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1852457&r1=1852456&r2=1852457&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Jan 29 14:24:18 2019
@@ -272,6 +272,10 @@
object factories) and merge them back into the core build.
(remm)
</update>
+ <add>
+ Update the internal fork of Apache Commons FileUpload to pick up the
+ changes in the Apache Commons FileUpload 1.4 release. (markt)
+ </add>
</changelog>
</subsection>
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]