优化
This commit is contained in:
@@ -180,6 +180,7 @@ open class WebDav(
|
|||||||
//依然是优化支持 caddy 自建的 WebDav ,其目录后缀都为“/”, 所以删除“/”的判定,不然无法获取该目录项
|
//依然是优化支持 caddy 自建的 WebDav ,其目录后缀都为“/”, 所以删除“/”的判定,不然无法获取该目录项
|
||||||
val href = element.findNS("href", ns)[0].text().replace("+", "%2B")
|
val href = element.findNS("href", ns)[0].text().replace("+", "%2B")
|
||||||
val hrefDecode = URLDecoder.decode(href, "UTF-8")
|
val hrefDecode = URLDecoder.decode(href, "UTF-8")
|
||||||
|
val fileName = hrefDecode.removeSuffix("/").substringAfterLast("/")
|
||||||
val webDavFile: WebDav
|
val webDavFile: WebDav
|
||||||
try {
|
try {
|
||||||
val urlName = hrefDecode.ifEmpty {
|
val urlName = hrefDecode.ifEmpty {
|
||||||
@@ -187,7 +188,7 @@ open class WebDav(
|
|||||||
}
|
}
|
||||||
val displayName = element
|
val displayName = element
|
||||||
.findNS("displayname", ns)
|
.findNS("displayname", ns)
|
||||||
.firstOrNull()?.text().orEmpty()
|
.firstOrNull()?.text()?.takeIf { it.isNotEmpty() } ?: fileName
|
||||||
val contentType = element
|
val contentType = element
|
||||||
.findNS("getcontenttype", ns)
|
.findNS("getcontenttype", ns)
|
||||||
.firstOrNull()?.text().orEmpty()
|
.firstOrNull()?.text().orEmpty()
|
||||||
|
|||||||
Reference in New Issue
Block a user