Loading src/main/kotlin/at/bitfire/dav4jvm/DavResource.kt +0 −62 Original line number Diff line number Diff line Loading @@ -603,68 +603,6 @@ open class DavResource @JvmOverloads constructor( } } /** * Sends a PROPPATCH request to the server in order to set and remove properties. * * @param setProperties map of properties that shall be set (values currently have to be strings) * @param removeProperties list of names of properties that shall be removed * @param callback called for every XML response element in the Multi-Status response * * Follows up to [MAX_REDIRECTS] redirects. * * Currently expects a 207 Multi-Status response although servers are allowed to * return other values, too. * * @throws IOException on I/O error * @throws HttpException on HTTP error * @throws DavException on WebDAV error (like no 207 Multi-Status response) or HTTPS -> HTTP redirect */ fun proppatch( setProperties: Map<Property.Name, String>, removeProperties: List<Property.Name>, callback: MultiResponseCallback ) { followRedirects { val rqBody = createProppatchXml(setProperties, removeProperties) httpClient.newCall( Request.Builder() .url(location) .method("PROPPATCH", rqBody.toRequestBody(MIME_XML)) .build() ).execute() }.use { // TODO handle not only 207 Multi-Status // http://www.webdav.org/specs/rfc4918.html#PROPPATCH-status processMultiStatus(it, callback) } } /** * Sends a SEARCH request (RFC 5323) with the given body to the server. * * Follows up to [MAX_REDIRECTS] redirects. Expects a 207 Multi-Status response. * * @param search search request body (XML format, DAV:searchrequest or DAV:query-schema-discovery) * @param callback called for every XML response element in the Multi-Status response * * @throws IOException on I/O error * @throws HttpException on HTTP error * @throws DavException on WebDAV error (like no 207 Multi-Status response) or HTTPS -> HTTP redirect */ fun search(search: String, callback: MultiResponseCallback) { followRedirects { httpClient.newCall(Request.Builder() .url(location) .method("SEARCH", search.toRequestBody(MIME_XML)) .build()).execute() }.use { processMultiStatus(it, callback) } } // status handling /** Loading Loading
src/main/kotlin/at/bitfire/dav4jvm/DavResource.kt +0 −62 Original line number Diff line number Diff line Loading @@ -603,68 +603,6 @@ open class DavResource @JvmOverloads constructor( } } /** * Sends a PROPPATCH request to the server in order to set and remove properties. * * @param setProperties map of properties that shall be set (values currently have to be strings) * @param removeProperties list of names of properties that shall be removed * @param callback called for every XML response element in the Multi-Status response * * Follows up to [MAX_REDIRECTS] redirects. * * Currently expects a 207 Multi-Status response although servers are allowed to * return other values, too. * * @throws IOException on I/O error * @throws HttpException on HTTP error * @throws DavException on WebDAV error (like no 207 Multi-Status response) or HTTPS -> HTTP redirect */ fun proppatch( setProperties: Map<Property.Name, String>, removeProperties: List<Property.Name>, callback: MultiResponseCallback ) { followRedirects { val rqBody = createProppatchXml(setProperties, removeProperties) httpClient.newCall( Request.Builder() .url(location) .method("PROPPATCH", rqBody.toRequestBody(MIME_XML)) .build() ).execute() }.use { // TODO handle not only 207 Multi-Status // http://www.webdav.org/specs/rfc4918.html#PROPPATCH-status processMultiStatus(it, callback) } } /** * Sends a SEARCH request (RFC 5323) with the given body to the server. * * Follows up to [MAX_REDIRECTS] redirects. Expects a 207 Multi-Status response. * * @param search search request body (XML format, DAV:searchrequest or DAV:query-schema-discovery) * @param callback called for every XML response element in the Multi-Status response * * @throws IOException on I/O error * @throws HttpException on HTTP error * @throws DavException on WebDAV error (like no 207 Multi-Status response) or HTTPS -> HTTP redirect */ fun search(search: String, callback: MultiResponseCallback) { followRedirects { httpClient.newCall(Request.Builder() .url(location) .method("SEARCH", search.toRequestBody(MIME_XML)) .build()).execute() }.use { processMultiStatus(it, callback) } } // status handling /** Loading