Skip to content

Commit dbe26b4

Browse files
committed
Performance: Remove peobably useless PROPFIND
Was introduced by fa61c6d.
1 parent cee8059 commit dbe26b4

2 files changed

Lines changed: 3 additions & 23 deletions

File tree

opencloudComLibrary/src/main/java/eu/opencloud/android/lib/resources/files/DownloadRemoteFileOperation.kt

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ package eu.opencloud.android.lib.resources.files
2626
import eu.opencloud.android.lib.common.OpenCloudClient
2727
import eu.opencloud.android.lib.common.http.HttpConstants
2828
import eu.opencloud.android.lib.common.http.methods.nonwebdav.GetMethod
29-
import eu.opencloud.android.lib.common.http.methods.webdav.DavConstants
30-
import eu.opencloud.android.lib.common.http.methods.webdav.DavUtils
31-
import eu.opencloud.android.lib.common.http.methods.webdav.PropfindMethod
3229
import eu.opencloud.android.lib.common.network.OnDatatransferProgressListener
3330
import eu.opencloud.android.lib.common.network.WebdavUtils
3431
import eu.opencloud.android.lib.common.operations.OperationCancelledException
@@ -68,18 +65,11 @@ class DownloadRemoteFileOperation(
6865
// download will be performed to a temporal file, then moved to the final location
6966
val tmpFile = File(tmpPath)
7067

71-
val propfindMethod = PropfindMethod(
72-
URL(client.userFilesWebDavUri.toString()),
73-
DavConstants.DEPTH_1,
74-
DavUtils.allPropSet
75-
)
76-
val status = client.executeHttpMethod(propfindMethod)
77-
7868
// perform the download
7969
return try {
8070
tmpFile.parentFile?.mkdirs()
81-
downloadFile(client, tmpFile).also {
82-
Timber.i("Download of $remotePath to $tmpPath - HTTP status code: $status")
71+
downloadFile(client, tmpFile).also { result ->
72+
Timber.i("Download of $remotePath to $tmpPath: ${result.logMessage}")
8373
}
8474
} catch (e: Exception) {
8575
RemoteOperationResult<Unit>(e).also { result ->

opencloudComLibrary/src/main/java/eu/opencloud/android/lib/resources/files/UploadFileFromFileSystemOperation.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ package eu.opencloud.android.lib.resources.files
2525

2626
import eu.opencloud.android.lib.common.OpenCloudClient
2727
import eu.opencloud.android.lib.common.http.HttpConstants
28-
import eu.opencloud.android.lib.common.http.methods.webdav.DavConstants
29-
import eu.opencloud.android.lib.common.http.methods.webdav.DavUtils
30-
import eu.opencloud.android.lib.common.http.methods.webdav.PropfindMethod
3128
import eu.opencloud.android.lib.common.http.methods.webdav.PutMethod
3229
import eu.opencloud.android.lib.common.network.FileRequestBody
3330
import eu.opencloud.android.lib.common.network.OnDatatransferProgressListener
@@ -72,21 +69,14 @@ open class UploadFileFromFileSystemOperation(
7269
override fun run(client: OpenCloudClient): RemoteOperationResult<Unit> {
7370
var result: RemoteOperationResult<Unit>
7471
try {
75-
val propfindMethod = PropfindMethod(
76-
URL(client.userFilesWebDavUri.toString()),
77-
DavConstants.DEPTH_1,
78-
DavUtils.allPropSet
79-
)
80-
val status = client.executeHttpMethod(propfindMethod)
81-
8272
if (cancellationRequested.get()) {
8373
// the operation was cancelled before getting it's turn to be executed in the queue of uploads
8474
result = RemoteOperationResult<Unit>(OperationCancelledException())
8575
Timber.i("Upload of $localPath to $remotePath has been cancelled")
8676
} else {
8777
// perform the upload
8878
result = uploadFile(client)
89-
Timber.i("Upload of $localPath to $remotePath - HTTP status code: $status")
79+
Timber.i("Upload of $localPath to $remotePath: ${result.logMessage}")
9080
}
9181
} catch (e: Exception) {
9282
if (putMethod?.isAborted == true) {

0 commit comments

Comments
 (0)