File tree Expand file tree Collapse file tree
owncloudApp/src/main/java/com/owncloud/android/workers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,13 +184,11 @@ class UploadFileFromContentUriWorker(
184184 }
185185 cacheFile.createNewFile()
186186
187- val inputStream = appContext.contentResolver.openInputStream(contentUri)
188- val outputStream = FileOutputStream (cachePath)
189- outputStream.use { fileOut ->
190- inputStream?.copyTo(fileOut)
187+ appContext.contentResolver.openInputStream(contentUri)?.use { inputStream ->
188+ FileOutputStream (cachePath).use { outputStream ->
189+ inputStream.copyTo(outputStream)
190+ }
191191 }
192- inputStream?.close()
193- outputStream.close()
194192
195193 transferRepository.updateTransferSourcePath(uploadIdInStorageManager, contentUri.toString())
196194 transferRepository.updateTransferLocalPath(uploadIdInStorageManager, cachePath)
You can’t perform that action at this time.
0 commit comments