Skip to content

Commit

Permalink
[WIP] Prevent premature closure of input streams
Browse files Browse the repository at this point in the history
Oops, we missed this difference from e0a4a11
  • Loading branch information
andrebrait committed May 18, 2024
1 parent b234f4d commit a0f8dc4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public FileTimes getFileTimes() {
@Override
public InputStream getInputStream() {
if (inputStream == null) {
inputStream = new BoundedInputStream(new SevenZFileInputStream(sevenZFile), sevenZArchiveEntry.getSize());
BoundedInputStream boundedInputStream = new BoundedInputStream(new SevenZFileInputStream(sevenZFile), sevenZArchiveEntry.getSize());
boundedInputStream.setPropagateClose(false);
inputStream = boundedInputStream;
}
return inputStream;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ private static FileTime fromEpochSeconds(@Nullable String seconds, @Nullable Dat
@Override
public InputStream getInputStream() {
if (inputStream == null) {
inputStream = new BoundedInputStream(tarArchiveInputStream, tarArchiveEntry.getRealSize());
BoundedInputStream boundedInputStream = new BoundedInputStream(tarArchiveInputStream, tarArchiveEntry.getRealSize());
boundedInputStream.setPropagateClose(false);
inputStream = boundedInputStream;
}
return inputStream;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public FileTimes getFileTimes() {
@Override
public InputStream getInputStream() {
if (inputStream == null) {
inputStream = new BoundedInputStream(processInputStream, file.getSize());
BoundedInputStream boundedInputStream = new BoundedInputStream(processInputStream, file.getSize());
boundedInputStream.setPropagateClose(false);
inputStream = boundedInputStream;
}
return inputStream;
}
Expand Down

0 comments on commit a0f8dc4

Please sign in to comment.