Skip to content

Commit 12a1941

Browse files
committed
[IO-798] DeferredFileOutputStream throws exception when system temp dir
is a symlink
1 parent c7d957d commit 12a1941

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/changes/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ The <action> type attribute can be add,update,fix,remove.
6767
<action dev="ggregory" type="fix" due-to="Gary Gregory">
6868
Only read the relevant portion of a file in AbstractOrigin.PathOrigin.getByteArray(long, int)
6969
</action>
70+
<action dev="ggregory" type="fix" due-to="Shai Shapira, Gary Gregory" issue="IO-798">
71+
DeferredFileOutputStream throws exception when system temp dir is a symlink.
72+
</action>
7073
<!-- ADD -->
7174
<action dev="ggregory" type="add" due-to="Gary Gregory">
7275
Add CharSequenceInputStream.Builder.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ protected void thresholdReached() throws IOException {
342342
if (prefix != null) {
343343
outputPath = Files.createTempFile(directory, prefix, suffix);
344344
}
345-
PathUtils.createParentDirectories(outputPath);
345+
PathUtils.createParentDirectories(outputPath, null, PathUtils.EMPTY_FILE_ATTRIBUTE_ARRAY);
346346
final OutputStream fos = Files.newOutputStream(outputPath);
347347
try {
348348
memoryOutputStream.writeTo(fos);

0 commit comments

Comments
 (0)