Author: ggregory
Date: Wed Aug 17 00:50:57 2016
New Revision: 1756570
URL: http://svn.apache.org/viewvc?rev=1756570&view=rev
Log:
[IO-512] ThresholdingOutputStream.thresholdReached() results in
FileNotFoundException.
Modified:
commons/proper/io/trunk/src/changes/changes.xml
commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java
Modified: commons/proper/io/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1756570&r1=1756569&r2=1756570&view=diff
==============================================================================
--- commons/proper/io/trunk/src/changes/changes.xml (original)
+++ commons/proper/io/trunk/src/changes/changes.xml Wed Aug 17 00:50:57 2016
@@ -52,6 +52,9 @@ The <action> type attribute can be add,u
</action>
</release>
<release version="2.6" date="2016-MM-DD" description="New features and bug
fixes.">
+ <action issue="IO-512" dev="ggregory" type="fix" due-to="Ralf Hauser">
+ ThresholdingOutputStream.thresholdReached() results in
FileNotFoundException.
+ </action>
<action issue="IO-511" dev="britter" type="fix" due-to="Ahmet Celik">
After a few unit tests, a few newly created directories not cleaned
completely.
</action>
Modified:
commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java
URL:
http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java?rev=1756570&r1=1756569&r2=1756570&view=diff
==============================================================================
---
commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java
(original)
+++
commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java
Wed Aug 17 00:50:57 2016
@@ -22,6 +22,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
@@ -176,6 +177,7 @@ public class DeferredFileOutputStream
if (prefix != null) {
outputFile = File.createTempFile(prefix, suffix, directory);
}
+ FileUtils.forceMkdirParent(outputFile);
final FileOutputStream fos = new FileOutputStream(outputFile);
try {
memoryOutputStream.writeTo(fos);