Skip to content

Commit 65e1c9c

Browse files
committed
[IO-512] ThresholdingOutputStream.thresholdReached() results in FileNotFoundException.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1756570 13f79535-47bb-0310-9956-ffa450edef68
1 parent d6beaa3 commit 65e1c9c

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/changes/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ The <action> type attribute can be add,update,fix,remove.
5252
</action>
5353
</release>
5454
<release version="2.6" date="2016-MM-DD" description="New features and bug fixes.">
55+
<action issue="IO-512" dev="ggregory" type="fix" due-to="Ralf Hauser">
56+
ThresholdingOutputStream.thresholdReached() results in FileNotFoundException.
57+
</action>
5558
<action issue="IO-511" dev="britter" type="fix" due-to="Ahmet Celik">
5659
After a few unit tests, a few newly created directories not cleaned completely.
5760
</action>

src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.IOException;
2323
import java.io.OutputStream;
2424

25+
import org.apache.commons.io.FileUtils;
2526
import org.apache.commons.io.IOUtils;
2627

2728

@@ -176,6 +177,7 @@ protected void thresholdReached() throws IOException
176177
if (prefix != null) {
177178
outputFile = File.createTempFile(prefix, suffix, directory);
178179
}
180+
FileUtils.forceMkdirParent(outputFile);
179181
final FileOutputStream fos = new FileOutputStream(outputFile);
180182
try {
181183
memoryOutputStream.writeTo(fos);

0 commit comments

Comments
 (0)