This commit is contained in:
Horis 2024-12-31 12:24:03 +08:00
parent 07f7f1bf3e
commit 3dec19f0ee
2 changed files with 12 additions and 2 deletions

View File

@ -211,7 +211,10 @@ open class WebDav(
.toInstant(ZoneOffset.of("+8")).toEpochMilli()
}
}.getOrNull() ?: 0
val fullURL = NetworkUtils.getAbsoluteURL(baseUrl, hrefDecode)
var fullURL = NetworkUtils.getAbsoluteURL(baseUrl, hrefDecode)
if (WebDavFile.isDir(contentType, resourceType) && !fullURL.endsWith("/")) {
fullURL += "/"
}
webDavFile = WebDavFile(
fullURL,
authorization,

View File

@ -16,7 +16,14 @@ class WebDavFile(
) : WebDav(urlStr, authorization) {
val isDir by lazy {
contentType == "httpd/unix-directory" || resourceType.lowercase().contains("collection")
isDir(contentType, resourceType)
}
companion object {
fun isDir(contentType: String, resourceType: String): Boolean {
return contentType == "httpd/unix-directory"
|| resourceType.lowercase().contains("collection")
}
}
}