This commit is contained in:
Horis committed 2024-12-31 12:24:03 +08:00
1 parent a4eeed1f55
commit 31a3918361
2 files changed
+12 -2

No files matched your search

@@ -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,
@@ -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")
}
}
}