You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by jo...@apache.org on 2017/11/23 20:10:20 UTC
[1/2] commons-fileupload git commit: PR: FileUpload-288 Avoid using
File.exists() on temporary files,
if we know that the file has been created. This closes #12.
Repository: commons-fileupload
Updated Branches:
refs/heads/master b57dcf4d3 -> 4242ff461
PR: FileUpload-288
Avoid using File.exists() on temporary files, if we know that the file
has been created.
This closes #12.
Project: http://git-wip-us.apache.org/repos/asf/commons-fileupload/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-fileupload/commit/180f6138
Tree: http://git-wip-us.apache.org/repos/asf/commons-fileupload/tree/180f6138
Diff: http://git-wip-us.apache.org/repos/asf/commons-fileupload/diff/180f6138
Branch: refs/heads/master
Commit: 180f6138b185a03ae1ee154b8048d67cf23af181
Parents: 2434446
Author: Jochen Wiedmann (jwi) <jo...@softwareag.com>
Authored: Thu Nov 23 21:07:27 2017 +0100
Committer: Jochen Wiedmann (jwi) <jo...@softwareag.com>
Committed: Thu Nov 23 21:07:27 2017 +0100
----------------------------------------------------------------------
pom.xml | 4 ++++
src/changes/changes.xml | 1 +
.../java/org/apache/commons/fileupload/disk/DiskFileItem.java | 4 ++--
3 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-fileupload/blob/180f6138/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b097ac2..322472a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -173,6 +173,10 @@
<name>David Sean Taylor</name>
<email>taylor@apache.org</email>
</contributor>
+ <contributor>
+ <name>fangwentong</name>
+ <email>fangwentong2012@gmail.com</email>
+ </contributor>
</contributors>
<scm>
http://git-wip-us.apache.org/repos/asf/commons-fileupload/blob/180f6138/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 55798e0..ec6823d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -61,6 +61,7 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ecki" type="add">Site: added security report</action>
<action dev="markt" due-to="Felix Schumacher">Improve performance for large multi-part boundaries</action>
<action issue="FILEUPLOAD-286" dev="jochen" due-to="maxxedev" due-to-email="maxxedev@gmail.com">Added the default character set to the DiskFileItem.</action>
+ <action issue="FILEUPLOAD-288" dev="jochen" due-to=""fangwentong" due-to-email="fangwentong2012@gmail.com">Avoid using File.exists() on temporary files, if we know that the file has been created.</action>
</release>
<release version="1.3.3" description="Bugfix release for 1.3.3" date="2017-06-13">
http://git-wip-us.apache.org/repos/asf/commons-fileupload/blob/180f6138/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
index 48004f3..1802131 100644
--- a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
@@ -415,7 +415,7 @@ public class DiskFileItem
public void delete() {
cachedContent = null;
File outputFile = getStoreLocation();
- if (outputFile != null && outputFile.exists()) {
+ if (outputFile != null && !isInMemory() && !outputFile.exists()) {
outputFile.delete();
}
}
@@ -523,7 +523,7 @@ public class DiskFileItem
*/
@Override
protected void finalize() {
- if (dfos == null) {
+ if (dfos == null || dfos.isInMemory()) {
return;
}
File outputFile = dfos.getFile();
[2/2] commons-fileupload git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/commons-fileupload.git
Posted by jo...@apache.org.
Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/commons-fileupload.git
Conflicts:
src/changes/changes.xml
Project: http://git-wip-us.apache.org/repos/asf/commons-fileupload/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-fileupload/commit/4242ff46
Tree: http://git-wip-us.apache.org/repos/asf/commons-fileupload/tree/4242ff46
Diff: http://git-wip-us.apache.org/repos/asf/commons-fileupload/diff/4242ff46
Branch: refs/heads/master
Commit: 4242ff461ef2fd28a41b04946c0161f3d891da54
Parents: 180f613 b57dcf4
Author: Jochen Wiedmann (jwi) <jo...@softwareag.com>
Authored: Thu Nov 23 21:10:15 2017 +0100
Committer: Jochen Wiedmann (jwi) <jo...@softwareag.com>
Committed: Thu Nov 23 21:10:15 2017 +0100
----------------------------------------------------------------------
src/changes/changes.xml | 4 ++++
.../java/org/apache/commons/fileupload/disk/DiskFileItem.java | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-fileupload/blob/4242ff46/src/changes/changes.xml
----------------------------------------------------------------------
diff --cc src/changes/changes.xml
index ec6823d,320db1d..0e9ae9c
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@@ -61,7 -61,7 +61,11 @@@ The <action> type attribute can be add,
<action dev="ecki" type="add">Site: added security report</action>
<action dev="markt" due-to="Felix Schumacher">Improve performance for large multi-part boundaries</action>
<action issue="FILEUPLOAD-286" dev="jochen" due-to="maxxedev" due-to-email="maxxedev@gmail.com">Added the default character set to the DiskFileItem.</action>
++<<<<<<< HEAD
+ <action issue="FILEUPLOAD-288" dev="jochen" due-to=""fangwentong" due-to-email="fangwentong2012@gmail.com">Avoid using File.exists() on temporary files, if we know that the file has been created.</action>
++=======
+ <action dev="jochen" due-to="Pascal Schumacher">Added .travis.yml, to fix build issues on Github.</action>
++>>>>>>> branch 'master' of https://git-wip-us.apache.org/repos/asf/commons-fileupload.git
</release>
<release version="1.3.3" description="Bugfix release for 1.3.3" date="2017-06-13">
http://git-wip-us.apache.org/repos/asf/commons-fileupload/blob/4242ff46/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
----------------------------------------------------------------------
diff --cc src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
index 1802131,48004f3..81aeebc
--- a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
@@@ -415,7 -415,7 +415,7 @@@ public class DiskFileIte
public void delete() {
cachedContent = null;
File outputFile = getStoreLocation();
- if (outputFile != null && !isInMemory() && !outputFile.exists()) {
- if (outputFile != null && outputFile.exists()) {
++ if (outputFile != null && !isInMemory() && outputFile.exists()) {
outputFile.delete();
}
}