From 3c48480d4c5c133fc69b5f8ceaa3de9561b5bf1c Mon Sep 17 00:00:00 2001 From: Armin Date: Wed, 27 Mar 2024 11:28:01 +0100 Subject: [PATCH] [LEIP-214] Remove unnecessary dir check --- .../de/cyface/app/digural/upload/WebdavUploader.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/digural/src/main/kotlin/de/cyface/app/digural/upload/WebdavUploader.kt b/ui/digural/src/main/kotlin/de/cyface/app/digural/upload/WebdavUploader.kt index 794aef4b..6dfd5149 100644 --- a/ui/digural/src/main/kotlin/de/cyface/app/digural/upload/WebdavUploader.kt +++ b/ui/digural/src/main/kotlin/de/cyface/app/digural/upload/WebdavUploader.kt @@ -206,11 +206,12 @@ class WebdavUploader( val isAttachmentUpload = !isMeasurementUpload // Attachment Upload - if (isAttachmentUpload && !sardine.exists(attachmentsDirectory(measurementId))) { - // Check if parent dir exists (should usually be the case) + val attachmentsDir = attachmentsDirectory(measurementId) + if (isAttachmentUpload && !sardine.exists(attachmentsDir)) { ensureMeasurementDirectoryExists(measurementId) - ensureDirectoryExists(sardine, attachmentsDirectory(measurementId)) - } else { + Log.d(TAG, "Creating directory: $attachmentsDir") + sardine.createDirectory(attachmentsDir) + } else if (isMeasurementUpload) { // Measurement Upload ensureMeasurementDirectoryExists(measurementId) }