Skip to content

Commit da98999

Browse files
committed
fix: resolve detekt issues and syntax error in TusUploadHelper
1 parent 449f4d9 commit da98999

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

opencloudApp/src/main/java/eu/opencloud/android/workers/TusUploadHelper.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ class TusUploadHelper(
7777
mimetype = mimeType,
7878
metadata = metadata,
7979
useCreationWithUpload = true,
80+
firstChunkSize = firstChunkSize,
81+
tusUrl = "",
82+
collectionUrlOverride = collectionUrl,
83+
).execute(client)
84+
}
85+
86+
if (creationResult == null) {
87+
throw java.io.IOException("TUS: unable to create upload resource for $remotePath")
88+
}
89+
90+
tusUrl = creationResult.uploadUrl
91+
createdOffset = creationResult.uploadOffset
92+
val metadataString = metadata.entries.joinToString(";") { (key, value) -> "$key=$value" }
8093

8194
transferRepository.updateTusState(
8295
id = uploadId,

opencloudComLibrary/src/test/java/eu/opencloud/android/lib/resources/files/tus/TusIntegrationTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ class TusIntegrationTest {
123123
assertNotNull(creationResult)
124124
val absoluteLocation = creationResult!!.uploadUrl
125125
val offset = creationResult.uploadOffset
126-
127126
println("absoluteLocation: $absoluteLocation")
128127
println("locationPath: $locationPath")
129128
println("endsWith: ${absoluteLocation.endsWith(locationPath)}")

0 commit comments

Comments
 (0)