Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit b65efc2

Browse files
abelgardepJuancaG05
authored andcommitted
Allow downloads from specific WebDav urls
1 parent 78665e8 commit b65efc2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/DownloadRemoteFileOperation.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import java.io.BufferedInputStream
3636
import java.io.File
3737
import java.io.FileOutputStream
3838
import java.net.URL
39-
import java.util.HashSet
4039
import java.util.concurrent.atomic.AtomicBoolean
4140

4241
/**
@@ -47,7 +46,8 @@ import java.util.concurrent.atomic.AtomicBoolean
4746
*/
4847
class DownloadRemoteFileOperation(
4948
private val remotePath: String,
50-
localFolderPath: String
49+
localFolderPath: String,
50+
private val spaceWebDavUrl: String? = null,
5151
) : RemoteOperation<Unit>() {
5252

5353
private val cancellationRequested = AtomicBoolean(false)
@@ -84,7 +84,8 @@ class DownloadRemoteFileOperation(
8484
var bis: BufferedInputStream? = null
8585
var savedFile = false
8686

87-
val getMethod = GetMethod(URL(client.userFilesWebDavUri.toString() + WebdavUtils.encodePath(remotePath)))
87+
val webDavUri = spaceWebDavUrl ?: client.userFilesWebDavUri.toString()
88+
val getMethod = GetMethod(URL(webDavUri + WebdavUtils.encodePath(remotePath)))
8889

8990
try {
9091
val status = client.executeHttpMethod(getMethod)

0 commit comments

Comments
 (0)