pull/78/head
kunfei 5 years ago
parent bf2504b61c
commit 7b080b9f16
  1. 19
      app/src/main/java/io/legado/app/lib/webdav/WebDav.kt

@ -23,13 +23,20 @@ class WebDav @Throws(MalformedURLException::class)
constructor(urlStr: String) { constructor(urlStr: String) {
companion object { companion object {
// 指定返回哪些属性 // 指定返回哪些属性
private const val DIR = "<?xml version=\"1.0\"?>\n" + private const val DIR =
"<a:propfind xmlns:a=\"DAV:\">\n" + """<?xml version="1.0"?>
"<a:prop>\n" + <a:propfind xmlns:a="DAV:">
"<a:displayname/>\n<a:resourcetype/>\n<a:getcontentlength/>\n<a:creationdate/>\n<a:getlastmodified/>\n%s" + <a:prop>
"</a:prop>\n" + <a:displayname/>
"</a:propfind>" <a:resourcetype/>
<a:getcontentlength/>
<a:creationdate/>
<a:getlastmodified/>
%s
</a:prop>
</a:propfind>"""
} }
private val url: URL = URL(null, urlStr, Handler) private val url: URL = URL(null, urlStr, Handler)
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://")

Loading…
Cancel
Save