|
1 | 1 | /* ownCloud Android Library is available under MIT license
|
2 |
| - * Copyright (C) 2022 ownCloud GmbH. |
| 2 | + * Copyright (C) 2023 ownCloud GmbH. |
3 | 3 | *
|
4 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 | 5 | * of this software and associated documentation files (the "Software"), to deal
|
@@ -48,13 +48,15 @@ import java.util.concurrent.atomic.AtomicBoolean
|
48 | 48 | * @author masensio
|
49 | 49 | * @author David González Verdugo
|
50 | 50 | * @author Abel García de Prada
|
| 51 | + * @author Juan Carlos Garrote Gascón |
51 | 52 | */
|
52 | 53 | open class UploadFileFromFileSystemOperation(
|
53 | 54 | val localPath: String,
|
54 | 55 | val remotePath: String,
|
55 | 56 | val mimeType: String,
|
56 | 57 | val lastModifiedTimestamp: String,
|
57 | 58 | val requiredEtag: String?,
|
| 59 | + val spaceWebDavUrl: String? = null, |
58 | 60 | ) : RemoteOperation<Unit>() {
|
59 | 61 |
|
60 | 62 | protected val cancellationRequested = AtomicBoolean(false)
|
@@ -97,7 +99,8 @@ open class UploadFileFromFileSystemOperation(
|
97 | 99 | synchronized(dataTransferListener) { it.addDatatransferProgressListeners(dataTransferListener) }
|
98 | 100 | }
|
99 | 101 |
|
100 |
| - putMethod = PutMethod(URL(client.userFilesWebDavUri.toString() + WebdavUtils.encodePath(remotePath)), fileRequestBody!!).apply { |
| 102 | + val baseStringUrl = spaceWebDavUrl ?: client.userFilesWebDavUri.toString() |
| 103 | + putMethod = PutMethod(URL(baseStringUrl + WebdavUtils.encodePath(remotePath)), fileRequestBody!!).apply { |
101 | 104 | retryOnConnectionFailure = false
|
102 | 105 | if (!requiredEtag.isNullOrBlank()) {
|
103 | 106 | addRequestHeader(HttpConstants.IF_MATCH_HEADER, requiredEtag)
|
|
0 commit comments