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) {
companion object {
// 指定返回哪些属性
private const val DIR = "<?xml version=\"1.0\"?>\n" +
"<a:propfind xmlns:a=\"DAV:\">\n" +
"<a:prop>\n" +
"<a:displayname/>\n<a:resourcetype/>\n<a:getcontentlength/>\n<a:creationdate/>\n<a:getlastmodified/>\n%s" +
"</a:prop>\n" +
"</a:propfind>"
private const val DIR =
"""<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:">
<a:prop>
<a:displayname/>
<a:resourcetype/>
<a:getcontentlength/>
<a:creationdate/>
<a:getlastmodified/>
%s
</a:prop>
</a:propfind>"""
}
private val url: URL = URL(null, urlStr, Handler)
private val httpUrl: String? by lazy {
val raw = url.toString().replace("davs://", "https://").replace("dav://", "http://")

Loading…
Cancel
Save