mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 14:45:47 +03:00
operations: properly close FileOutputStream.
Classes that implement the Closeable interface or its super-interface, AutoCloseable, needs to be closed after use. try-with-resources does this for you automatically. Signed-off-by: ardevd <edvard.holst@gmail.com> Signed-off-by: nextcloud-android-bot <android@nextcloud.com> Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
23c9ea0cf4
commit
c59b41d761
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