Commit 216c21c2 authored by Ricki Hirner's avatar Ricki Hirner

Merge branch 'more_webdav_properties' into 'master'

Include CreationDate, GetContentLength and quota properties

See merge request bitfireAT/dav4android!4
parents 3911d771 d23a8575
Pipeline #31371469 passed with stages
in 6 minutes and 27 seconds
......@@ -28,4 +28,5 @@ Email: [play@bitfire.at](mailto:play@bitfire.at)
## Contributors
* Ricki Hirner (initial contributor)
* David González Verdugo (dgonzalez@owncloud.com)
/*
* 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 http://mozilla.org/MPL/2.0/.
*/
package at.bitfire.dav4android.property
import at.bitfire.dav4android.Property
import at.bitfire.dav4android.PropertyFactory
import at.bitfire.dav4android.XmlUtils
import org.xmlpull.v1.XmlPullParser
data class CreationDate(
var creationDate: String
): Property {
companion object {
@JvmField
val NAME = Property.Name(XmlUtils.NS_WEBDAV, "creationdate")
}
class Factory: PropertyFactory {
override fun getName() = NAME
override fun create(parser: XmlPullParser): CreationDate? {
XmlUtils.readText(parser)?.let { it ->
return CreationDate(it)
}
return null
}
}
}
\ No newline at end of file
/*
* 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 http://mozilla.org/MPL/2.0/.
*/
package at.bitfire.dav4android.property
import at.bitfire.dav4android.Property
import at.bitfire.dav4android.PropertyFactory
import at.bitfire.dav4android.XmlUtils
import org.xmlpull.v1.XmlPullParser
data class GetContentLength(
val contentLength: Long
) : Property {
companion object {
@JvmField
val NAME = Property.Name(XmlUtils.NS_WEBDAV, "getcontentlength")
}
class Factory : PropertyFactory {
override fun getName() = NAME
override fun create(parser: XmlPullParser): GetContentLength? {
XmlUtils.readText(parser)?.let {
return GetContentLength(it.toLong())
}
return null
}
}
}
\ No newline at end of file
/*
* 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 http://mozilla.org/MPL/2.0/.
*/
package at.bitfire.dav4android.property
import at.bitfire.dav4android.Property
import at.bitfire.dav4android.PropertyFactory
import at.bitfire.dav4android.XmlUtils
import org.xmlpull.v1.XmlPullParser
data class QuotaAvailableBytes(
val quotaAvailableBytes: Long
) : Property {
companion object {
@JvmField
val NAME = Property.Name(XmlUtils.NS_WEBDAV, "quota-available-bytes")
}
class Factory : PropertyFactory {
override fun getName() = NAME
override fun create(parser: XmlPullParser): QuotaAvailableBytes? {
XmlUtils.readText(parser)?.let {
return QuotaAvailableBytes(it.toLong())
}
return null
}
}
}
\ No newline at end of file
/*
* 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 http://mozilla.org/MPL/2.0/.
*/
package at.bitfire.dav4android.property
import at.bitfire.dav4android.Property
import at.bitfire.dav4android.PropertyFactory
import at.bitfire.dav4android.XmlUtils
import org.xmlpull.v1.XmlPullParser
data class QuotaUsedBytes(
val quotaUsedBytes: Long
) : Property {
companion object {
@JvmField
val NAME = Property.Name(XmlUtils.NS_WEBDAV, "quota-used-bytes")
}
class Factory : PropertyFactory {
override fun getName() = NAME
override fun create(parser: XmlPullParser): QuotaUsedBytes? {
XmlUtils.readText(parser)?.let {
return QuotaUsedBytes(it.toLong())
}
return null
}
}
}
\ No newline at end of file
......@@ -9,14 +9,18 @@ at.bitfire.dav4android.property.CalendarProxyReadFor$Factory
at.bitfire.dav4android.property.CalendarProxyWriteFor$Factory
at.bitfire.dav4android.property.CalendarTimezone$Factory
at.bitfire.dav4android.property.CalendarUserAddressSet$Factory
at.bitfire.dav4android.property.CreationDate$Factory
at.bitfire.dav4android.property.CurrentUserPrincipal$Factory
at.bitfire.dav4android.property.CurrentUserPrivilegeSet$Factory
at.bitfire.dav4android.property.DisplayName$Factory
at.bitfire.dav4android.property.GetContentLength$Factory
at.bitfire.dav4android.property.GetContentType$Factory
at.bitfire.dav4android.property.GetCTag$Factory
at.bitfire.dav4android.property.GetETag$Factory
at.bitfire.dav4android.property.GetLastModified$Factory
at.bitfire.dav4android.property.GroupMembership$Factory
at.bitfire.dav4android.property.QuotaAvailableBytes$Factory
at.bitfire.dav4android.property.QuotaUsedBytes$Factory
at.bitfire.dav4android.property.ResourceType$Factory
at.bitfire.dav4android.property.Source$Factory
at.bitfire.dav4android.property.SupportedAddressData$Factory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment