Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1169e150 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Update okhttp, tests in Kotlin, refactoring

parent 568f0285
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line

buildscript {
    ext.kotlin_version = '1.2.21'
    ext.kotlin_version = '1.2.30'
    ext.dokka_version = '0.9.15'

    repositories {
@@ -52,12 +52,12 @@ android {
dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    compile 'com.squareup.okhttp3:okhttp:3.9.1'
    compile 'com.squareup.okhttp3:okhttp:3.10.0'

    androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.9.1'
    androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.10.0'
    androidTestCompile 'com.android.support.test:runner:1.0.1'

    testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
    testCompile 'junit:junit:4.12'
    testCompile 'com.squareup.okhttp3:mockwebserver:3.9.1'
    testCompile 'com.squareup.okhttp3:mockwebserver:3.10.0'
}
+2 −2
Original line number Diff line number Diff line
@@ -40,8 +40,8 @@ class BasicDigestAuthHandler(
        private val HEADER_AUTHORIZATION = "Authorization"

        // cached digest parameters
        @JvmField var clientNonce = h(UUID.randomUUID().toString())
        @JvmField var nonceCount = AtomicInteger(1)
        var clientNonce = h(UUID.randomUUID().toString())
        var nonceCount = AtomicInteger(1)

        fun quotedString(s: String) = "\"" + s.replace("\"", "\\\"") + "\""
        fun h(data: String) = ByteString.of(ByteBuffer.wrap(data.toByteArray())).md5().hex()!!
+0 −1
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@ import java.util.logging.Logger

object Constants {

    @JvmField
    var log = Logger.getLogger("dav4android")!!

}
 No newline at end of file
+0 −5
Original line number Diff line number Diff line
@@ -22,10 +22,7 @@ class DavAddressBook @JvmOverloads constructor(
): DavCollection(httpClient, location, log) {

    companion object {
        @JvmField
        val MIME_VCARD3_UTF8 = MediaType.parse("text/vcard;charset=utf-8")

        @JvmField
        val MIME_VCARD4 = MediaType.parse("text/vcard;version=4.0")
    }

@@ -36,7 +33,6 @@ class DavAddressBook @JvmOverloads constructor(
     * @throws HttpException on HTTP error
     * @throws DavException on DAV error
     */
    @Throws(IOException::class, HttpException::class, DavException::class)
    fun addressbookQuery() {
        /* <!ELEMENT addressbook-query ((DAV:allprop |
                                         DAV:propname |
@@ -78,7 +74,6 @@ class DavAddressBook @JvmOverloads constructor(
     * @throws HttpException on HTTP error
     * @throws DavException on DAV error
     */
    @Throws(IOException::class, HttpException::class, DavException::class)
    fun multiget(urls: List<HttpUrl>, vCard4: Boolean) {
        /* <!ELEMENT addressbook-multiget ((DAV:allprop |
                                            DAV:propname |
Loading