1
0
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:
Abel García de Prada 2022-01-18 13:11:02 +01:00 committed by Abel García de Prada
parent 12040a1261
commit 1f499fb67d
2 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@ open class UploadFileFromFileSystemOperation(
val remotePath: String,
val mimeType: String,
val lastModifiedTimestamp: String,
val requiredEtag: String,
val requiredEtag: String?,
) : RemoteOperation<Unit>() {
protected val cancellationRequested = AtomicBoolean(false)
@ -98,7 +98,7 @@ open class UploadFileFromFileSystemOperation(
putMethod = PutMethod(URL(client.userFilesWebDavUri.toString() + WebdavUtils.encodePath(remotePath)), fileRequestBody!!).apply {
setRetryOnConnectionFailure(false)
if (requiredEtag.isNotBlank()) {
if (!requiredEtag.isNullOrBlank()) {
addRequestHeader(HttpConstants.IF_MATCH_HEADER, requiredEtag)
}
addRequestHeader(HttpConstants.OC_TOTAL_LENGTH_HEADER, fileToUpload.length().toString())

View File

@ -54,7 +54,7 @@ class ChunkedUploadFromFileSystemOperation(
remotePath: String,
mimeType: String,
lastModifiedTimestamp: String,
requiredEtag: String,
requiredEtag: String?,
) : UploadFileFromFileSystemOperation(
localPath = localPath,
remotePath = remotePath,