From 7045fc87b1553bca61bbc4bbbb24267002f854d2 Mon Sep 17 00:00:00 2001 From: Arnau Mora Date: Tue, 11 Nov 2025 13:07:09 +0100 Subject: [PATCH 1/7] Fix misusages of Ktor --- .idea/codeStyles/Project.xml | 34 +++++++++++++++++++ .../kotlin/at/bitfire/dav4jvm/HttpHeaders.kt | 16 +++++++++ .../kotlin/at/bitfire/dav4jvm/UsesKtor.kt | 16 +++++++++ .../kotlin/at/bitfire/dav4jvm/XmlReader.kt | 1 + .../dav4jvm/property/caldav/ScheduleTag.kt | 5 +-- .../property/caldav/SupportedCalendarData.kt | 2 ++ .../property/carddav/SupportedAddressData.kt | 3 ++ .../dav4jvm/property/webdav/GetETag.kt | 6 ++-- 8 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 src/main/kotlin/at/bitfire/dav4jvm/HttpHeaders.kt create mode 100644 src/main/kotlin/at/bitfire/dav4jvm/UsesKtor.kt diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 2e921232..7da446aa 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -2,5 +2,39 @@ \ No newline at end of file diff --git a/src/main/kotlin/at/bitfire/dav4jvm/HttpHeaders.kt b/src/main/kotlin/at/bitfire/dav4jvm/HttpHeaders.kt new file mode 100644 index 00000000..e7d37b67 --- /dev/null +++ b/src/main/kotlin/at/bitfire/dav4jvm/HttpHeaders.kt @@ -0,0 +1,16 @@ +/* + * Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package at.bitfire.dav4jvm + +object HttpHeaders { + val ETag: String = "ETag" + val ScheduleTag: String = "Schedule-Tag" +} diff --git a/src/main/kotlin/at/bitfire/dav4jvm/UsesKtor.kt b/src/main/kotlin/at/bitfire/dav4jvm/UsesKtor.kt new file mode 100644 index 00000000..6edba28f --- /dev/null +++ b/src/main/kotlin/at/bitfire/dav4jvm/UsesKtor.kt @@ -0,0 +1,16 @@ +/* + * Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package at.bitfire.dav4jvm + +/** + * Marker annotation to indicate that a class or function in the common code uses the Ktor library. + */ +annotation class UsesKtor diff --git a/src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt b/src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt index f0d9661d..364cdd77 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt @@ -161,6 +161,7 @@ class XmlReader( * @param tagName The name of the tag that contains the [CONTENT_TYPE] attribute value. * @param onNewType Called every time a new [ContentType] is found. */ + @UsesKtor fun readContentTypes(tagName: Property.Name, onNewType: (String) -> Unit) { try { processTag(tagName) { diff --git a/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt b/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt index 74f5e81b..1f28a977 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt @@ -10,13 +10,13 @@ package at.bitfire.dav4jvm.property.caldav +import at.bitfire.dav4jvm.HttpHeaders import at.bitfire.dav4jvm.Property import at.bitfire.dav4jvm.PropertyFactory import at.bitfire.dav4jvm.QuotedStringUtils +import at.bitfire.dav4jvm.UsesKtor import at.bitfire.dav4jvm.XmlReader -import at.bitfire.dav4jvm.property.webdav.GetETag import io.ktor.client.statement.HttpResponse -import io.ktor.http.HttpHeaders import okhttp3.Response import org.xmlpull.v1.XmlPullParser @@ -29,6 +29,7 @@ data class ScheduleTag( @JvmField val NAME = Property.Name(NS_CALDAV, "schedule-tag") + @UsesKtor fun fromHttpResponse(response: HttpResponse) = response.headers[HttpHeaders.ScheduleTag]?.let { ScheduleTag(it) } diff --git a/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/SupportedCalendarData.kt b/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/SupportedCalendarData.kt index b8cc67f9..dedbbfe9 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/SupportedCalendarData.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/SupportedCalendarData.kt @@ -12,6 +12,7 @@ package at.bitfire.dav4jvm.property.caldav import at.bitfire.dav4jvm.Property import at.bitfire.dav4jvm.PropertyFactory +import at.bitfire.dav4jvm.UsesKtor import at.bitfire.dav4jvm.XmlReader import io.ktor.http.ContentType import org.xmlpull.v1.XmlPullParser @@ -31,6 +32,7 @@ data class SupportedCalendarData( } + @UsesKtor fun hasJCal() = types .map { ContentType.parse(it) } .any { ContentType.Application.contains(it) && "calendar+json".equals(it.contentSubtype, true) } diff --git a/src/main/kotlin/at/bitfire/dav4jvm/property/carddav/SupportedAddressData.kt b/src/main/kotlin/at/bitfire/dav4jvm/property/carddav/SupportedAddressData.kt index b860f81d..6dbc86f2 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/property/carddav/SupportedAddressData.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/property/carddav/SupportedAddressData.kt @@ -12,6 +12,7 @@ package at.bitfire.dav4jvm.property.carddav import at.bitfire.dav4jvm.Property import at.bitfire.dav4jvm.PropertyFactory +import at.bitfire.dav4jvm.UsesKtor import at.bitfire.dav4jvm.XmlReader import io.ktor.http.ContentType import org.xmlpull.v1.XmlPullParser @@ -31,9 +32,11 @@ class SupportedAddressData( } + @UsesKtor fun hasVCard4() = types .map { try { ContentType.parse(it) } catch (_: Exception) { ContentType.Any } } .any { "text/vcard; version=4.0".equals(it.toString(), true) } + @UsesKtor fun hasJCard() = types .map { try { ContentType.parse(it) } catch (_: Exception) { ContentType.Any } } .any { ContentType.Application.contains(it) && "vcard+json".equals(it.contentSubtype, true) } diff --git a/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt b/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt index 8fcb0821..523ffb79 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt @@ -10,12 +10,13 @@ package at.bitfire.dav4jvm.property.webdav +import at.bitfire.dav4jvm.HttpHeaders import at.bitfire.dav4jvm.Property import at.bitfire.dav4jvm.PropertyFactory import at.bitfire.dav4jvm.QuotedStringUtils +import at.bitfire.dav4jvm.UsesKtor import at.bitfire.dav4jvm.XmlReader import io.ktor.client.statement.HttpResponse -import io.ktor.http.HttpHeaders import okhttp3.Response import org.xmlpull.v1.XmlPullParser @@ -33,11 +34,12 @@ data class GetETag( @JvmField val NAME = Property.Name(NS_WEBDAV, "getetag") + @UsesKtor fun fromHttpResponse(response: HttpResponse) = response.headers[HttpHeaders.ETag]?.let { GetETag(it) } fun fromResponse(response: Response) = - response.header("ETag")?.let { GetETag(it) } + response.header(HttpHeaders.ETag)?.let { GetETag(it) } } /** From a0f3bd50f8195d580c41761f4f55bffcb95ba4c8 Mon Sep 17 00:00:00 2001 From: Arnau Mora Date: Tue, 11 Nov 2025 13:13:20 +0100 Subject: [PATCH 2/7] Remove mis-commited file --- .idea/codeStyles/Project.xml | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 7da446aa..2e921232 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -2,39 +2,5 @@ \ No newline at end of file From 886033a5a370ce878d8b0a2818fb0b5227a750df Mon Sep 17 00:00:00 2001 From: Arnau Mora Date: Wed, 12 Nov 2025 11:26:18 +0100 Subject: [PATCH 3/7] Rename headers class, use const, and add new headers --- .../at/bitfire/dav4jvm/HttpHeaderNames.kt | 25 +++++++++++++++++++ .../kotlin/at/bitfire/dav4jvm/HttpHeaders.kt | 16 ------------ .../dav4jvm/property/caldav/ScheduleTag.kt | 6 ++--- .../dav4jvm/property/webdav/GetETag.kt | 6 ++--- 4 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 src/main/kotlin/at/bitfire/dav4jvm/HttpHeaderNames.kt delete mode 100644 src/main/kotlin/at/bitfire/dav4jvm/HttpHeaders.kt diff --git a/src/main/kotlin/at/bitfire/dav4jvm/HttpHeaderNames.kt b/src/main/kotlin/at/bitfire/dav4jvm/HttpHeaderNames.kt new file mode 100644 index 00000000..759cd03d --- /dev/null +++ b/src/main/kotlin/at/bitfire/dav4jvm/HttpHeaderNames.kt @@ -0,0 +1,25 @@ +/* + * Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package at.bitfire.dav4jvm + +object HttpHeaderNames { + /** [RFC4229 Section-2.1.2](https://datatracker.ietf.org/doc/html/rfc4229#section-2.1.2) */ + const val Accept: String = "Accept" + + /** [RFC4229 Section-2.1.5](https://datatracker.ietf.org/doc/html/rfc4229#section-2.1.5) */ + const val AcceptEncoding: String = "Accept-Encoding" + + /** [RFC4229 Section-2.1.45](https://datatracker.ietf.org/doc/html/rfc4229#section-2.1.45) */ + const val ETag: String = "ETag" + + /** [RFC6638 Section-8.2](https://datatracker.ietf.org/doc/html/rfc6638#section-8.2) */ + const val ScheduleTag: String = "Schedule-Tag" +} diff --git a/src/main/kotlin/at/bitfire/dav4jvm/HttpHeaders.kt b/src/main/kotlin/at/bitfire/dav4jvm/HttpHeaders.kt deleted file mode 100644 index e7d37b67..00000000 --- a/src/main/kotlin/at/bitfire/dav4jvm/HttpHeaders.kt +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package at.bitfire.dav4jvm - -object HttpHeaders { - val ETag: String = "ETag" - val ScheduleTag: String = "Schedule-Tag" -} diff --git a/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt b/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt index 1f28a977..a9b86786 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt @@ -10,7 +10,7 @@ package at.bitfire.dav4jvm.property.caldav -import at.bitfire.dav4jvm.HttpHeaders +import at.bitfire.dav4jvm.HttpHeaderNames import at.bitfire.dav4jvm.Property import at.bitfire.dav4jvm.PropertyFactory import at.bitfire.dav4jvm.QuotedStringUtils @@ -31,10 +31,10 @@ data class ScheduleTag( @UsesKtor fun fromHttpResponse(response: HttpResponse) = - response.headers[HttpHeaders.ScheduleTag]?.let { ScheduleTag(it) } + response.headers[HttpHeaderNames.ScheduleTag]?.let { ScheduleTag(it) } fun fromResponse(response: Response) = - response.header(HttpHeaders.ScheduleTag)?.let { ScheduleTag(it) } + response.header(HttpHeaderNames.ScheduleTag)?.let { ScheduleTag(it) } } diff --git a/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt b/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt index 523ffb79..882663f6 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt @@ -10,7 +10,7 @@ package at.bitfire.dav4jvm.property.webdav -import at.bitfire.dav4jvm.HttpHeaders +import at.bitfire.dav4jvm.HttpHeaderNames import at.bitfire.dav4jvm.Property import at.bitfire.dav4jvm.PropertyFactory import at.bitfire.dav4jvm.QuotedStringUtils @@ -36,10 +36,10 @@ data class GetETag( @UsesKtor fun fromHttpResponse(response: HttpResponse) = - response.headers[HttpHeaders.ETag]?.let { GetETag(it) } + response.headers[HttpHeaderNames.ETag]?.let { GetETag(it) } fun fromResponse(response: Response) = - response.header(HttpHeaders.ETag)?.let { GetETag(it) } + response.header(HttpHeaderNames.ETag)?.let { GetETag(it) } } /** From 6fb79db071100c491c006bdd1eb18770aa8cb66f Mon Sep 17 00:00:00 2001 From: Arnau Mora Date: Wed, 12 Nov 2025 11:29:24 +0100 Subject: [PATCH 4/7] Add notice to readme --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 2afe40e3..58fb5bf2 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,18 @@ For questions, suggestions etc. use [Github discussions](https://github.com/bitf We're happy about contributions, but please let us know in the discussions before. Then make the changes in your own repository and send a pull request. +> [!INFO] +> dav4jvm is currently being rewritten to use ktor instead of OkHttp to allow Kotlin Multiplatform support, and other engines. +> +> In the mean time, there are two packages available: +> - `at.bitfire.dav4jvm.okhttp` (the current one, using OkHttp, JVM only) +> - `io.github.mcdjuady.ktor` (new package, uses ktor, supports Kotlin Multiplatform) +> +> There's some common code shared between both packages, **and we cannot guarantee** that all of it is excluded from cross-dependencies (generic code using ktor-specific functions). +> The usages are most likely indicated in the kdoc, but something might be missing. +> +> Take this into consideration if you are going to exclude the ktor dependency on your project. + ## Installation From 642ad6b31436c6101030553918745f9a3d41be44 Mon Sep 17 00:00:00 2001 From: Arnau Mora Date: Wed, 12 Nov 2025 11:32:19 +0100 Subject: [PATCH 5/7] Remove the `UsesKtor` annotation Signed-off-by: Arnau Mora --- src/main/kotlin/at/bitfire/dav4jvm/UsesKtor.kt | 16 ---------------- src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt | 3 ++- .../dav4jvm/property/caldav/ScheduleTag.kt | 7 +++++-- .../property/caldav/SupportedCalendarData.kt | 7 +++++-- .../property/carddav/SupportedAddressData.kt | 14 +++++++++++--- .../bitfire/dav4jvm/property/webdav/GetETag.kt | 7 +++++-- 6 files changed, 28 insertions(+), 26 deletions(-) delete mode 100644 src/main/kotlin/at/bitfire/dav4jvm/UsesKtor.kt diff --git a/src/main/kotlin/at/bitfire/dav4jvm/UsesKtor.kt b/src/main/kotlin/at/bitfire/dav4jvm/UsesKtor.kt deleted file mode 100644 index 6edba28f..00000000 --- a/src/main/kotlin/at/bitfire/dav4jvm/UsesKtor.kt +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package at.bitfire.dav4jvm - -/** - * Marker annotation to indicate that a class or function in the common code uses the Ktor library. - */ -annotation class UsesKtor diff --git a/src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt b/src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt index 364cdd77..3b01ee79 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt @@ -158,10 +158,11 @@ class XmlReader( * Processes all the tags named [tagName], and sends every tag that has the [CONTENT_TYPE] * attribute with [onNewType]. * + * **Requires Ktor.** + * * @param tagName The name of the tag that contains the [CONTENT_TYPE] attribute value. * @param onNewType Called every time a new [ContentType] is found. */ - @UsesKtor fun readContentTypes(tagName: Property.Name, onNewType: (String) -> Unit) { try { processTag(tagName) { diff --git a/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt b/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt index a9b86786..b7eed4dd 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt @@ -14,7 +14,6 @@ import at.bitfire.dav4jvm.HttpHeaderNames import at.bitfire.dav4jvm.Property import at.bitfire.dav4jvm.PropertyFactory import at.bitfire.dav4jvm.QuotedStringUtils -import at.bitfire.dav4jvm.UsesKtor import at.bitfire.dav4jvm.XmlReader import io.ktor.client.statement.HttpResponse import okhttp3.Response @@ -29,7 +28,11 @@ data class ScheduleTag( @JvmField val NAME = Property.Name(NS_CALDAV, "schedule-tag") - @UsesKtor + /** + * Creates a [ScheduleTag] from an HTTP response's `Schedule-Tag` header. + * + * **Requires Ktor.** + */ fun fromHttpResponse(response: HttpResponse) = response.headers[HttpHeaderNames.ScheduleTag]?.let { ScheduleTag(it) } diff --git a/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/SupportedCalendarData.kt b/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/SupportedCalendarData.kt index dedbbfe9..ad81b795 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/SupportedCalendarData.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/property/caldav/SupportedCalendarData.kt @@ -12,7 +12,6 @@ package at.bitfire.dav4jvm.property.caldav import at.bitfire.dav4jvm.Property import at.bitfire.dav4jvm.PropertyFactory -import at.bitfire.dav4jvm.UsesKtor import at.bitfire.dav4jvm.XmlReader import io.ktor.http.ContentType import org.xmlpull.v1.XmlPullParser @@ -32,7 +31,11 @@ data class SupportedCalendarData( } - @UsesKtor + /** + * Checks whether the supported calendar data includes JCal (application/calendar+json). + * + * **Requires Ktor.** + */ fun hasJCal() = types .map { ContentType.parse(it) } .any { ContentType.Application.contains(it) && "calendar+json".equals(it.contentSubtype, true) } diff --git a/src/main/kotlin/at/bitfire/dav4jvm/property/carddav/SupportedAddressData.kt b/src/main/kotlin/at/bitfire/dav4jvm/property/carddav/SupportedAddressData.kt index 6dbc86f2..43f6669e 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/property/carddav/SupportedAddressData.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/property/carddav/SupportedAddressData.kt @@ -12,7 +12,6 @@ package at.bitfire.dav4jvm.property.carddav import at.bitfire.dav4jvm.Property import at.bitfire.dav4jvm.PropertyFactory -import at.bitfire.dav4jvm.UsesKtor import at.bitfire.dav4jvm.XmlReader import io.ktor.http.ContentType import org.xmlpull.v1.XmlPullParser @@ -32,11 +31,20 @@ class SupportedAddressData( } - @UsesKtor + /** + * Checks whether the supported address data includes vCard 4.0 (`text/vcard; version=4.0`). + * + * **Requires Ktor.** + */ fun hasVCard4() = types .map { try { ContentType.parse(it) } catch (_: Exception) { ContentType.Any } } .any { "text/vcard; version=4.0".equals(it.toString(), true) } - @UsesKtor + + /** + * Checks whether the supported address data includes JCard (`application/vcard+json`). + * + * **Requires Ktor.** + */ fun hasJCard() = types .map { try { ContentType.parse(it) } catch (_: Exception) { ContentType.Any } } .any { ContentType.Application.contains(it) && "vcard+json".equals(it.contentSubtype, true) } diff --git a/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt b/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt index 882663f6..c1f77363 100644 --- a/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt +++ b/src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetETag.kt @@ -14,7 +14,6 @@ import at.bitfire.dav4jvm.HttpHeaderNames import at.bitfire.dav4jvm.Property import at.bitfire.dav4jvm.PropertyFactory import at.bitfire.dav4jvm.QuotedStringUtils -import at.bitfire.dav4jvm.UsesKtor import at.bitfire.dav4jvm.XmlReader import io.ktor.client.statement.HttpResponse import okhttp3.Response @@ -34,7 +33,11 @@ data class GetETag( @JvmField val NAME = Property.Name(NS_WEBDAV, "getetag") - @UsesKtor + /** + * Creates a [GetETag] from an HTTP response's `ETag` header. + * + * **Requires Ktor.** + */ fun fromHttpResponse(response: HttpResponse) = response.headers[HttpHeaderNames.ETag]?.let { GetETag(it) } From e9b5dba03f531050dc1830c176693a39427419c7 Mon Sep 17 00:00:00 2001 From: Arnau Mora Date: Wed, 12 Nov 2025 11:35:24 +0100 Subject: [PATCH 6/7] Typo Signed-off-by: Arnau Mora --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58fb5bf2..8e89f7b1 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ For questions, suggestions etc. use [Github discussions](https://github.com/bitf We're happy about contributions, but please let us know in the discussions before. Then make the changes in your own repository and send a pull request. -> [!INFO] +> [!NOTE] > dav4jvm is currently being rewritten to use ktor instead of OkHttp to allow Kotlin Multiplatform support, and other engines. > > In the mean time, there are two packages available: From 9b7a3736b51e0d8757df60f451f48ebb48077f79 Mon Sep 17 00:00:00 2001 From: Arnau Mora Date: Wed, 12 Nov 2025 11:49:23 +0100 Subject: [PATCH 7/7] Typo wtf Signed-off-by: Arnau Mora --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e89f7b1..81e68e52 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ in your own repository and send a pull request. > > In the mean time, there are two packages available: > - `at.bitfire.dav4jvm.okhttp` (the current one, using OkHttp, JVM only) -> - `io.github.mcdjuady.ktor` (new package, uses ktor, supports Kotlin Multiplatform) +> - `at.bitfire.dav4jvm.ktor` (new package, uses ktor, supports Kotlin Multiplatform) > > There's some common code shared between both packages, **and we cannot guarantee** that all of it is excluded from cross-dependencies (generic code using ktor-specific functions). > The usages are most likely indicated in the kdoc, but something might be missing.