Loading src/main/kotlin/at/bitfire/dav4jvm/CallbackInterfaces.kt +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ fun interface MultiResponseCallback { * in response to a `PROPFIND` request, this callback will be called once for every found * member resource. * * Known collections have [response] `href` with trailing slash, see [at.bitfire.dav4jvm.Response.parse] for details. * * @param response the parsed response (including URL) * @param relation relation of the response to the called resource */ Loading src/main/kotlin/at/bitfire/dav4jvm/Response.kt +52 −43 Original line number Diff line number Diff line Loading @@ -100,7 +100,15 @@ data class Response( val LOCATION = Property.Name(XmlUtils.NS_WEBDAV, "location") /** * Parses an XML response element. * Parses an XML response element and calls the [callback] for it (when it has a `<href>`). * The arguments of the [MultiResponseCallback.onResponse] are set accordingly. * * If the [ResourceType] of the queried resource is known (= was queried and returned by the server) * and it contains [ResourceType.COLLECTION], the `href` property of the callback will automatically * have a trailing slash. * * So if you want PROPFIND results to have a trailing slash when they are collections, make sure * that you query [ResourceType]. */ fun parse(parser: XmlPullParser, location: HttpUrl, callback: MultiResponseCallback) { val depth = parser.depth Loading Loading @@ -214,7 +222,8 @@ data class Response( error, newLocation ), relation) relation ) } } Loading Loading
src/main/kotlin/at/bitfire/dav4jvm/CallbackInterfaces.kt +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ fun interface MultiResponseCallback { * in response to a `PROPFIND` request, this callback will be called once for every found * member resource. * * Known collections have [response] `href` with trailing slash, see [at.bitfire.dav4jvm.Response.parse] for details. * * @param response the parsed response (including URL) * @param relation relation of the response to the called resource */ Loading
src/main/kotlin/at/bitfire/dav4jvm/Response.kt +52 −43 Original line number Diff line number Diff line Loading @@ -100,7 +100,15 @@ data class Response( val LOCATION = Property.Name(XmlUtils.NS_WEBDAV, "location") /** * Parses an XML response element. * Parses an XML response element and calls the [callback] for it (when it has a `<href>`). * The arguments of the [MultiResponseCallback.onResponse] are set accordingly. * * If the [ResourceType] of the queried resource is known (= was queried and returned by the server) * and it contains [ResourceType.COLLECTION], the `href` property of the callback will automatically * have a trailing slash. * * So if you want PROPFIND results to have a trailing slash when they are collections, make sure * that you query [ResourceType]. */ fun parse(parser: XmlPullParser, location: HttpUrl, callback: MultiResponseCallback) { val depth = parser.depth Loading Loading @@ -214,7 +222,8 @@ data class Response( error, newLocation ), relation) relation ) } } Loading