diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/ReadRemoteFileOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/ReadRemoteFileOperation.kt index 539ea92c..cf29b60e 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/ReadRemoteFileOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/ReadRemoteFileOperation.kt @@ -46,7 +46,10 @@ import java.util.concurrent.TimeUnit * @author David González Verdugo */ -class ReadRemoteFileOperation(val remotePath: String) : RemoteOperation() { +class ReadRemoteFileOperation( + val remotePath: String, + val spaceWebDavUrl: String? = null, +) : RemoteOperation() { /** * Performs the read operation. @@ -57,7 +60,7 @@ class ReadRemoteFileOperation(val remotePath: String) : RemoteOperation { try { val propFind = PropfindMethod( - url = URL("${client.userFilesWebDavUri}${WebdavUtils.encodePath(remotePath)}"), + url = getFinalWebDavUrl(), depth = DEPTH_0, propertiesToRequest = DavUtils.allPropset ).apply { @@ -69,10 +72,11 @@ class ReadRemoteFileOperation(val remotePath: String) : RemoteOperation(RemoteOperationResult.ResultCode.OK).apply { @@ -88,6 +92,12 @@ class ReadRemoteFileOperation(val remotePath: String) : RemoteOperation fun readFile( - remotePath: String + remotePath: String, + spaceWebDavUrl: String? = null, ): RemoteOperationResult fun refreshFolder( diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCFileService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCFileService.kt index 037e5ef2..e2affc8a 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCFileService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/services/implementation/OCFileService.kt @@ -91,10 +91,12 @@ class OCFileService(override val client: OwnCloudClient) : FileService { ).execute(client) override fun readFile( - remotePath: String + remotePath: String, + spaceWebDavUrl: String?, ): RemoteOperationResult = ReadRemoteFileOperation( - remotePath = remotePath + remotePath = remotePath, + spaceWebDavUrl = spaceWebDavUrl, ).execute(client) override fun refreshFolder(