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