|
|
@@ -2,7 +2,6 @@ package io.legado.app.lib.webdav
|
|
|
|
|
|
import io.legado.app.data.appDb
|
|
|
import io.legado.app.data.entities.Server.WebDavConfig
|
|
|
-import io.legado.app.exception.NoStackTraceException
|
|
|
import okhttp3.Credentials
|
|
|
import java.nio.charset.Charset
|
|
|
import java.nio.charset.StandardCharsets
|
|
|
@@ -24,7 +23,7 @@ data class Authorization(
|
|
|
}
|
|
|
|
|
|
constructor(serverID: Long?): this("","") {
|
|
|
- serverID ?: throw NoStackTraceException("Unexpected server ID")
|
|
|
+ serverID ?: throw WebDavException("Unexpected server ID")
|
|
|
appDb.serverDao.get(serverID)?.getWebDavConfig()?.run {
|
|
|
data = Credentials.basic(username, password, charset)
|
|
|
} ?: throw WebDavException("Unexpected WebDav Authorization")
|