mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 07:05:49 +03:00
Merge pull request #3789 from nextcloud/try-with-resources-in-download-file-operation
operations: properly close FileOutputStream.
This commit is contained in:
commit
d4c008188a
2 changed files with 4 additions and 3 deletions
|
@ -1 +1 @@
|
|||
474
|
||||
473
|
|
@ -203,8 +203,9 @@ public class DownloadFileOperation extends RemoteOperation {
|
|||
try {
|
||||
byte[] decryptedBytes = EncryptionUtils.decryptFile(tmpFile, key, iv, authenticationTag);
|
||||
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(tmpFile);
|
||||
fileOutputStream.write(decryptedBytes);
|
||||
try (FileOutputStream fileOutputStream = new FileOutputStream(tmpFile)) {
|
||||
fileOutputStream.write(decryptedBytes);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return new RemoteOperationResult(e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue