-
-
Notifications
You must be signed in to change notification settings - Fork 20
Added ktor-version in dedicated package #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ktor-version in dedicated package #95
Conversation
It only affects the ktor package, so it should be fine :) One thing I wonder: would it be possible to not duplicate the properties? Because they should be data classes and depend only on XML parsing. |
As far as I have seen, the files in the
What do you think? |
Hi, basically it could be done, shouldn't be much effort anyway. From my point of view it would make sense to adapt the Ktor version in a way that also the parser is Multiplatform compatible. If the properties are shared, another solution must be found about how to proceed when the XMLPullParser is replaced by another solution. |
I understand, but I wouldn't like to have two different XML parsers (one for okhttp and one for ktor) and different properties in dav4jvm, if avoidable. So my preferred way would be:
Would that be a feasible way for you? Or would it be too slow? But you could change the XML parser and properties in a separate branch anyway. |
Created dedicated constructors in ScheduleTag.kt each for ktor and okhttp
ad 1) However, there are small changes that are not super clean, but in my eyes acceptable:
ad 2-4) The current PR would be ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
As long as we don't need the ktor package in davx5, I think we can explicitly exclude the dependency when we import dav4jvm.
I was too fast. Will have a look at these |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really have to introduce breaking changes in this PR? Would it not be better to leave that for another PR too?
src/main/kotlin/at/bitfire/dav4jvm/okhttp/exception/HttpException.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt
Outdated
Show resolved
Hide resolved
imported Error file properly, adapted companion objects for eTag and ScheduleTag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with the imports now. What do you think about retaining the method signature @rfc2822 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR reorganizes the dav4jvm library by moving shared code out of the OkHttp-specific package into a common base package, creating a dedicated Ktor implementation package with equivalent functionality. The changes establish a clear separation between HTTP client implementations while maintaining backward compatibility for the OkHttp version.
- Extracts common classes (
Property
,XmlUtils
,HttpUtils
, etc.) fromokhttp
package to basedav4jvm
package - Creates new
ktor
package with Ktor-based implementations of DAV client functionality - Updates all import statements across test and source files to reference the new package structure
Reviewed Changes
Copilot reviewed 133 out of 134 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
Property classes | Moved from okhttp-specific to common base package for reuse across implementations |
Test files | Updated imports and added Ktor-specific test implementations |
OkHttp classes | Updated imports to reference moved common classes, retained OkHttp-specific functionality |
Ktor classes | New implementation using Ktor HTTP client with equivalent WebDAV functionality |
Exception classes | Created Ktor-specific exception hierarchy mirroring OkHttp structure |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/main/kotlin/at/bitfire/dav4jvm/property/caldav/ScheduleTag.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/at/bitfire/dav4jvm/property/webdav/GetContentType.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, only two minor things are left.
@rfc2822 sounds good, changes are done :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍🏻
As @sunkup already wrote "looks good" before, I'll now merge |
No description provided.