Skip to content

Commit

Permalink
[LEIP-214] Remove unnecessary dir check
Browse files Browse the repository at this point in the history
  • Loading branch information
hb0 committed Mar 27, 2024
1 parent 745e0d7 commit 3c48480
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 3c48480

Please sign in to comment.