bitfireat / dav4jvm Goto Github PK
View Code? Open in Web Editor NEWWebDAV (including CalDAV, CardDAV) library for the Java virtual machine (Java/Kotlin)
License: Mozilla Public License 2.0
WebDAV (including CalDAV, CardDAV) library for the Java virtual machine (Java/Kotlin)
License: Mozilla Public License 2.0
POST
can also useful for resources that are not collections.
POST
from DavCollection
to DavResource
A server may return a Location header with a differently percentage encoded value, e.g. whether to encode [
and ]
. rclone serve webdav
is one server that has this behavior. Since we are already creating URI instances from HttpUrl, we can just compare them to check for this kind of equality.
This is from #41 but without the actual one-line code because I might not be abel to sign the CLA.
Looking at the pom files from https://jitpack.io/#bitfireAT/dav4jvm I see for the older build aac98bd:
$ cat /home/michael/.gradle/caches/modules-2/files-2.1/com.github.bitfireAT/dav4jvm/aac98bd76cf3034194c9ba6d2bf58212083a72a0/d2579180d429882b73048f6224b82214ff9df3a1/dav4jvm-aac98bd76cf3034194c9ba6d2bf58212083a72a0.pom
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- do_not_remove: published-with-gradle-metadata -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.bitfireAT</groupId>
<artifactId>dav4jvm</artifactId>
<version>aac98bd76cf3034194c9ba6d2bf58212083a72a0</version>
<name>bitfireAT/dav4jvm</name>
<description>WebDAV (including CalDAV, CardDAV) library for the Java virtual machine (Java/Kotlin)</description>
<url>https://github.com/bitfireAT/dav4jvm</url>
<inceptionYear>2021</inceptionYear>
<licenses>
<license>
<name>Mozilla Public License 2.0</name>
<url>https://api.github.com/licenses/mpl-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>bitfireAT</id>
<name>bitfire web engineering</name>
<email>[email protected]</email>
</developer>
</developers>
<scm>
<connection>scm:git://github.com/bitfireAT/dav4jvm.git</connection>
<developerConnection>scm:git://github.com/bitfireAT/dav4jvm.git</developerConnection>
<url>git://github.com/bitfireAT/dav4jvm.git</url>
</scm>
<dependencies>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.10.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.ogce</groupId>
<artifactId>xpp3</artifactId>
<version>1.1.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk7</artifactId>
<version>1.7.20</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
The newer build 47dd6a9 is missing some vital information, like license, name, description.
$ cat /home/michael/.gradle/caches/modules-2/files-2.1/com.github.bitfireAT/dav4jvm/47dd6a9/fbd606a36fe0220f24c628ee6e2812e449e4943f/dav4jvm-47dd6a9.pom
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- do_not_remove: published-with-gradle-metadata -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.bitfireAT</groupId>
<artifactId>dav4jvm</artifactId>
<version>47dd6a9</version>
<dependencies>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.11.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.ogce</groupId>
<artifactId>xpp3</artifactId>
<version>1.1.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>1.8.21</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
Add a get()
method that doesn't call a callback, but returns the unconsumed okhttp Response
.
See #36
Especially in context of #8 (comment)
Currently, Property.parse()
doesn't allow properties to fail, so something like <multistatus><getetag/></multistatus>
can only be handled as an existing, but empty GetETag property (with null values in it).
However, GetETag with null values doesn't make sense.
So the following changes should be done:
Property.parse()
to ignore invalid exceptions (InvalidPropertyException
)GetETag
factory throws an InvalidPropertyException
when there's no ETag textGetETag
constructor can require a String
(instead of String?
)Currently GetETag
ignores the weakness indicator (W/
prefix, see https://datatracker.ietf.org/doc/html/rfc7232#section-2.3).
For correct interpretation, the weakness indicator must not be ignored. In WebDAV context, in most cases only strong ETags are useful so DAVx⁵ has to know whether an ETag is weak or strong.
So we need
The signature (at.bitfire.dav4jvm.Response, at.bitfire.dav4jvm.Response.HrefRelation) -> Unit
is repeatedly used in DavResource
.
I think it should be a functional interface (with SAM interface).
WebDAV file timestamps from the server are off by two hours, which is the difference between local time and UTC.
On the server:
> stat -c '%Y' myfile
1683307068
On the Android device
> content query --uri content://at.bitfire.davdroid.webdav/document/15
...last_modified=1683299868000
...
Originally posted by @Zimbelstern in #11
Latest DAVx⁵ with current dav4jvm can't parse dates in the preferred format like Mon, 01 May 2023 08:52:19 GMT
anymore, causing the WebDAV timestamps to be null
.
Happens on Android 13 (also in the emulator). Steps to reproduce:
null
because the times were not parsedLooking at
The code only sets Overwrite: F
when forceOverride
is true
, however A value of "F" states that the server should not perform the COPY Method or MOVE Method if the state of the destination resource is not null
(source), which seems to be the opposite.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.