Skip to content

Commit

Permalink
Properly try-catches the stream as well, not just the channel 馃毃
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobvogel committed Sep 18, 2023
1 parent db11b75 commit a45dc10
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/ninja/S3Dispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,9 @@ private File combineParts(String id, String uploadId, List<File> parts) {

file.getName(), file.getAbsolutePath());
}
try (FileChannel out = new FileOutputStream(file).getChannel()) {
combine(parts, out);
try (FileOutputStream outStream = new FileOutputStream(file);
FileChannel outChannel = outStream.getChannel()) {
combine(parts, outChannel);
}
} catch (IOException e) {
throw Exceptions.handle(e);
Expand Down

0 comments on commit a45dc10

Please sign in to comment.