Skip to content

Multiplatform support #15

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

Closed
wants to merge 7 commits into from
Closed

Multiplatform support #15

wants to merge 7 commits into from

Conversation

McDjuady
Copy link

I decided to convert the library to multiplatform, since I needed it for a project of mine.
So far I only tested the JVM variant, but adding other versions shouldn't be too difficult, since all libraries are multiplatform libraries themselves.

Major changes include:

  • Moved from OkHttp3 to Ktor-Client (Which can use OkHttp3 ofcourse)
  • Use suspend functions
  • Changed from xmlpp to io.github.pdvrieze.xmlutil
  • Use kotest for testing

I don't know if you even want this library to be a multiplatform library, so if not just let me know and I'll keep the fork to myself :)
Otherwise I'd be very happy for feedback on the changes.

Cheers
Max

McDjuady added 6 commits June 12, 2023 17:47
Switched from okhttp3 to ktor
Switched from junit to kotest
Switched from xmlpp to xmlutil
Added klock for time/date management
Removed BasicDigestAuth, can be done using ktor with two authenticators
Reworked tests to use ktor-mock-client and kotest
followRedirect was removed, will need to be investigated if this can be done using the Ktor provided HttpRedirect plugin of if a custom one is necessary
- Fixed Exception initialization by moving from a constructor into a suspend operator fun
- Moved XMLWriter&XMLReader creation into XMLUtils for more control
- Use HttpClient.prepareRequest to allow for multiple reads
- Fixed MockClient usage in DavCollectionTest
- Fixed DavExceptioTests
- Improved request construction in DavResource
- Fixed headers in DavResourceTest.testOptions
- Use XmlUtils.processTag as a centralized function to walk xml
- Fixed an issue where Response.isSuccess was returning false when the Response was actually successful
- Fixed StatusLine parsing
- Fixed UrlUtils.equals
- Improved UrlUtilsTest to be data driven
- Fixed XML Traversal to conform to the new XmlReader (depth was handled differently)
Not quite the same as the old implementation, but it's valid xml
Initial support for redirect follow
- This will need some work, since it currently relies on the HttpRedirect plugin to be configured to allow redirect on all methods
Improved XmlUtils.processTag
Fixed an issue with multistatus tests
@CLAassistant
Copy link

CLAassistant commented Jun 14, 2023

CLA assistant check
All committers have signed the CLA.

…viour

Add missing header to DavCollection.post
Fix an issue where the namespace was missing for a prefix when using the generic XMLWriter
Fixed an issue reading text when using the generic XMLReader
@ArnyminerZ
Copy link
Member

Wow, such a big PR, it will surely take a while to review. In the meantime, please, make sure all tests are passing

@ArnyminerZ ArnyminerZ requested a review from rfc2822 June 14, 2023 14:03
@rfc2822
Copy link
Member

rfc2822 commented Jun 14, 2023

Unfortunately these changes are currently not in the DAVx5 scope and we primarly use dav4jvm for DAVx5. Thanks for the PR and I encourage you to keep the fork up to date, but at the moment we can't merge this.

@rfc2822 rfc2822 closed this Jun 14, 2023
@jonas-app
Copy link

I just wanted to let you know that I would also be interested in the multiplatform support for my current pet project.
Not assuming any change based on this, just want to show that there are more people out there that would use it.

Thx bitfire for your work! 👏 I own all the DAVx⁵ badges. ❤️

And thx @McDjuady for your effort and the fork, I will check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants