mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Make requireEtag nullable
This commit is contained in:
parent
e620de4fce
commit
aa7d8f92b0
@ -55,7 +55,7 @@ open class UploadFileFromFileSystemOperation(
|
|||||||
val remotePath: String,
|
val remotePath: String,
|
||||||
val mimeType: String,
|
val mimeType: String,
|
||||||
val lastModifiedTimestamp: String,
|
val lastModifiedTimestamp: String,
|
||||||
val requiredEtag: String,
|
val requiredEtag: String?,
|
||||||
) : RemoteOperation<Unit>() {
|
) : RemoteOperation<Unit>() {
|
||||||
|
|
||||||
protected val cancellationRequested = AtomicBoolean(false)
|
protected val cancellationRequested = AtomicBoolean(false)
|
||||||
@ -98,7 +98,7 @@ open class UploadFileFromFileSystemOperation(
|
|||||||
|
|
||||||
putMethod = PutMethod(URL(client.userFilesWebDavUri.toString() + WebdavUtils.encodePath(remotePath)), fileRequestBody!!).apply {
|
putMethod = PutMethod(URL(client.userFilesWebDavUri.toString() + WebdavUtils.encodePath(remotePath)), fileRequestBody!!).apply {
|
||||||
setRetryOnConnectionFailure(false)
|
setRetryOnConnectionFailure(false)
|
||||||
if (requiredEtag.isNotBlank()) {
|
if (!requiredEtag.isNullOrBlank()) {
|
||||||
addRequestHeader(HttpConstants.IF_MATCH_HEADER, requiredEtag)
|
addRequestHeader(HttpConstants.IF_MATCH_HEADER, requiredEtag)
|
||||||
}
|
}
|
||||||
addRequestHeader(HttpConstants.OC_TOTAL_LENGTH_HEADER, fileToUpload.length().toString())
|
addRequestHeader(HttpConstants.OC_TOTAL_LENGTH_HEADER, fileToUpload.length().toString())
|
||||||
|
@ -54,7 +54,7 @@ class ChunkedUploadFromFileSystemOperation(
|
|||||||
remotePath: String,
|
remotePath: String,
|
||||||
mimeType: String,
|
mimeType: String,
|
||||||
lastModifiedTimestamp: String,
|
lastModifiedTimestamp: String,
|
||||||
requiredEtag: String,
|
requiredEtag: String?,
|
||||||
) : UploadFileFromFileSystemOperation(
|
) : UploadFileFromFileSystemOperation(
|
||||||
localPath = localPath,
|
localPath = localPath,
|
||||||
remotePath = remotePath,
|
remotePath = remotePath,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user