mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +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 {
|
try {
|
||||||
byte[] decryptedBytes = EncryptionUtils.decryptFile(tmpFile, key, iv, authenticationTag);
|
byte[] decryptedBytes = EncryptionUtils.decryptFile(tmpFile, key, iv, authenticationTag);
|
||||||
|
|
||||||
FileOutputStream fileOutputStream = new FileOutputStream(tmpFile);
|
try (FileOutputStream fileOutputStream = new FileOutputStream(tmpFile)) {
|
||||||
fileOutputStream.write(decryptedBytes);
|
fileOutputStream.write(decryptedBytes);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return new RemoteOperationResult(e);
|
return new RemoteOperationResult(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue