android-library icon indicating copy to clipboard operation
android-library copied to clipboard

[BUG] NumberFormatException if <d:creationdate> contains a date

Open bohwaz opened this issue 3 years ago • 2 comments

Actual behaviour

If the WebDAV server returns a creationdate for a resource, the app generated an exception: NumberFormatException : For input string "Mon, 03 Oct 2022 02:06:28 GMT"

Expected behaviour

No exception.

bohwaz avatar Oct 03 '22 02:10 bohwaz

Hi @bohwaz, you are right. The creation date resource is parsed to a number to work with it as a timestamp. And, of course, it fails.

We could add a new check to parse the string as a Date in case the number parsing fails and then retrieve the timestamp from it. So it would work exactly the same.

I'll transfer the issue to the android-library repository which is the one that handles all the network requests 👍

abelgardep avatar Oct 03 '22 07:10 abelgardep

It would be a bit cleaner as the WebDAV spec says that creationdate must be a RFC3339 formatted string: https://datatracker.ietf.org/doc/html/rfc4918#section-15.1

bohwaz avatar Oct 03 '22 10:10 bohwaz