From b65efc2b691dd1fe77a7d60c134a7447f8e47d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garc=C3=ADa=20de=20Prada?= Date: Thu, 2 Feb 2023 14:30:34 +0100 Subject: [PATCH] Allow downloads from specific WebDav urls --- .../lib/resources/files/DownloadRemoteFileOperation.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/DownloadRemoteFileOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/DownloadRemoteFileOperation.kt index 80b9adc7..86fcde46 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/DownloadRemoteFileOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/DownloadRemoteFileOperation.kt @@ -36,7 +36,6 @@ import java.io.BufferedInputStream import java.io.File import java.io.FileOutputStream import java.net.URL -import java.util.HashSet import java.util.concurrent.atomic.AtomicBoolean /** @@ -47,7 +46,8 @@ import java.util.concurrent.atomic.AtomicBoolean */ class DownloadRemoteFileOperation( private val remotePath: String, - localFolderPath: String + localFolderPath: String, + private val spaceWebDavUrl: String? = null, ) : RemoteOperation() { private val cancellationRequested = AtomicBoolean(false) @@ -84,7 +84,8 @@ class DownloadRemoteFileOperation( var bis: BufferedInputStream? = null var savedFile = false - val getMethod = GetMethod(URL(client.userFilesWebDavUri.toString() + WebdavUtils.encodePath(remotePath))) + val webDavUri = spaceWebDavUrl ?: client.userFilesWebDavUri.toString() + val getMethod = GetMethod(URL(webDavUri + WebdavUtils.encodePath(remotePath))) try { val status = client.executeHttpMethod(getMethod)