Loading README.md +1 −0 Original line number Diff line number Diff line Loading @@ -29,4 +29,5 @@ Email: [play@bitfire.at](mailto:play@bitfire.at) * Ricki Hirner (initial contributor) * David González Verdugo (dgonzalez@owncloud.com) * Matt Jacobsen (https://gitlab.com/mattjacobsen) build.gradle +2 −2 Original line number Diff line number Diff line buildscript { ext.kotlin_version = '1.3.10' ext.kotlin_version = '1.3.11' ext.dokka_version = '0.9.17' repositories { Loading Loading @@ -61,7 +61,7 @@ dependencies { api "com.squareup.okhttp3:okhttp:$okhttp_version" androidTestImplementation "com.squareup.okhttp3:mockwebserver:$okhttp_version" androidTestImplementation 'androidx.test:runner:1.1.0' androidTestImplementation 'androidx.test:runner:1.1.1' testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" testImplementation 'junit:junit:4.12' Loading src/main/java/at/bitfire/dav4android/DavResource.kt +2 −0 Original line number Diff line number Diff line Loading @@ -350,6 +350,8 @@ open class DavResource @JvmOverloads constructor( throw when (code) { HttpURLConnection.HTTP_UNAUTHORIZED -> if (response != null) UnauthorizedException(response) else UnauthorizedException(message) HttpURLConnection.HTTP_FORBIDDEN -> if (response != null) ForbiddenException(response) else ForbiddenException(message) HttpURLConnection.HTTP_NOT_FOUND -> if (response != null) NotFoundException(response) else NotFoundException(message) HttpURLConnection.HTTP_CONFLICT -> Loading src/main/java/at/bitfire/dav4android/Error.kt +11 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,17 @@ class Error( return names.map { Error(it) } } // some pre-defined errors val NEED_PRIVILEGES = Error(Property.Name(XmlUtils.NS_WEBDAV, "need-privileges")) val VALID_SYNC_TOKEN = Error(Property.Name(XmlUtils.NS_WEBDAV, "valid-sync-token")) } override fun equals(other: Any?) = (other is Error) && other.name == name override fun hashCode() = name.hashCode() } src/main/java/at/bitfire/dav4android/exception/ForbiddenException.kt 0 → 100644 +17 −0 Original line number Diff line number Diff line /* * 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.exception import okhttp3.Response import java.net.HttpURLConnection class ForbiddenException: HttpException { constructor(response: Response): super(response) constructor(message: String?): super(HttpURLConnection.HTTP_FORBIDDEN, message) } Loading
README.md +1 −0 Original line number Diff line number Diff line Loading @@ -29,4 +29,5 @@ Email: [play@bitfire.at](mailto:play@bitfire.at) * Ricki Hirner (initial contributor) * David González Verdugo (dgonzalez@owncloud.com) * Matt Jacobsen (https://gitlab.com/mattjacobsen)
build.gradle +2 −2 Original line number Diff line number Diff line buildscript { ext.kotlin_version = '1.3.10' ext.kotlin_version = '1.3.11' ext.dokka_version = '0.9.17' repositories { Loading Loading @@ -61,7 +61,7 @@ dependencies { api "com.squareup.okhttp3:okhttp:$okhttp_version" androidTestImplementation "com.squareup.okhttp3:mockwebserver:$okhttp_version" androidTestImplementation 'androidx.test:runner:1.1.0' androidTestImplementation 'androidx.test:runner:1.1.1' testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" testImplementation 'junit:junit:4.12' Loading
src/main/java/at/bitfire/dav4android/DavResource.kt +2 −0 Original line number Diff line number Diff line Loading @@ -350,6 +350,8 @@ open class DavResource @JvmOverloads constructor( throw when (code) { HttpURLConnection.HTTP_UNAUTHORIZED -> if (response != null) UnauthorizedException(response) else UnauthorizedException(message) HttpURLConnection.HTTP_FORBIDDEN -> if (response != null) ForbiddenException(response) else ForbiddenException(message) HttpURLConnection.HTTP_NOT_FOUND -> if (response != null) NotFoundException(response) else NotFoundException(message) HttpURLConnection.HTTP_CONFLICT -> Loading
src/main/java/at/bitfire/dav4android/Error.kt +11 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,17 @@ class Error( return names.map { Error(it) } } // some pre-defined errors val NEED_PRIVILEGES = Error(Property.Name(XmlUtils.NS_WEBDAV, "need-privileges")) val VALID_SYNC_TOKEN = Error(Property.Name(XmlUtils.NS_WEBDAV, "valid-sync-token")) } override fun equals(other: Any?) = (other is Error) && other.name == name override fun hashCode() = name.hashCode() }
src/main/java/at/bitfire/dav4android/exception/ForbiddenException.kt 0 → 100644 +17 −0 Original line number Diff line number Diff line /* * 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.exception import okhttp3.Response import java.net.HttpURLConnection class ForbiddenException: HttpException { constructor(response: Response): super(response) constructor(message: String?): super(HttpURLConnection.HTTP_FORBIDDEN, message) }