Skip to content

Commit b8be778

Browse files
committed
WebDAV Push: add push-message property
1 parent dd49701 commit b8be778

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Java/Kotlin files
1212
*.class
13-
kotlin/
13+
.kotlin/
1414

1515
# Generated files
1616
bin/

src/main/kotlin/at/bitfire/dav4jvm/PropertyRegistry.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import at.bitfire.dav4jvm.property.carddav.AddressData
2323
import at.bitfire.dav4jvm.property.carddav.AddressbookDescription
2424
import at.bitfire.dav4jvm.property.carddav.AddressbookHomeSet
2525
import at.bitfire.dav4jvm.property.carddav.SupportedAddressData
26+
import at.bitfire.dav4jvm.property.push.PushMessage
2627
import at.bitfire.dav4jvm.property.push.PushSubscribe
2728
import at.bitfire.dav4jvm.property.push.PushTransports
2829
import at.bitfire.dav4jvm.property.push.Subscription
@@ -84,6 +85,7 @@ object PropertyRegistry {
8485
at.bitfire.dav4jvm.property.caldav.MaxResourceSize.Factory,
8586
at.bitfire.dav4jvm.property.carddav.MaxResourceSize.Factory,
8687
Owner.Factory,
88+
PushMessage.Factory,
8789
PushSubscribe.Factory,
8890
PushTransports.Factory,
8991
QuotaAvailableBytes.Factory,
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* This Source Code Form is subject to the terms of the Mozilla Public
3+
* License, v. 2.0. If a copy of the MPL was not distributed with this
4+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5+
*/
6+
7+
package at.bitfire.dav4jvm.property.push
8+
9+
import at.bitfire.dav4jvm.Property
10+
import at.bitfire.dav4jvm.PropertyFactory
11+
import at.bitfire.dav4jvm.XmlUtils
12+
import org.xmlpull.v1.XmlPullParser
13+
14+
/**
15+
* Represents a `{DAV:Push}push-message` property.
16+
*
17+
* Experimental! See https://github.com/bitfireAT/webdav-push/
18+
*/
19+
class PushMessage(
20+
val topic: String?
21+
): Property {
22+
23+
companion object {
24+
25+
@JvmField
26+
val NAME = Property.Name(NS_WEBDAV_PUSH, "push-message")
27+
28+
}
29+
30+
31+
object Factory: PropertyFactory {
32+
33+
override fun getName() = NAME
34+
35+
override fun create(parser: XmlPullParser) =
36+
PushMessage(XmlUtils.readTextProperty(parser, Topic.NAME))
37+
38+
}
39+
40+
}

0 commit comments

Comments
 (0)