pull/1994/head
kunfei 2 years ago
parent d62c757cc4
commit 4da7880bb3
  1. 6
      app/src/main/java/io/legado/app/lib/webdav/WebDav.kt

@ -25,7 +25,7 @@ import java.time.ZoneOffset
import java.time.format.DateTimeFormatter
@Suppress("unused", "MemberVisibilityCanBePrivate")
open class WebDav(urlStr: String, val authorization: Authorization) {
open class WebDav(val path: String, val authorization: Authorization) {
companion object {
@SuppressLint("DateTimeFormatter")
@ -47,7 +47,7 @@ open class WebDav(urlStr: String, val authorization: Authorization) {
</a:propfind>"""
}
private val url: URL = URL(urlStr)
private val url: URL = URL(path)
private val httpUrl: String? by lazy {
val raw = url.toString().replace("davs://", "https://").replace("dav://", "http://")
return@lazy kotlin.runCatching {
@ -58,8 +58,6 @@ open class WebDav(urlStr: String, val authorization: Authorization) {
}.getOrNull()
}
val host: String? get() = url.host
val path get() = url.toString()
/**
* 获取当前url文件信息

Loading…
Cancel
Save