优化
This commit is contained in:
@@ -211,7 +211,10 @@ open class WebDav(
|
|||||||
.toInstant(ZoneOffset.of("+8")).toEpochMilli()
|
.toInstant(ZoneOffset.of("+8")).toEpochMilli()
|
||||||
}
|
}
|
||||||
}.getOrNull() ?: 0
|
}.getOrNull() ?: 0
|
||||||
val fullURL = NetworkUtils.getAbsoluteURL(baseUrl, hrefDecode)
|
var fullURL = NetworkUtils.getAbsoluteURL(baseUrl, hrefDecode)
|
||||||
|
if (WebDavFile.isDir(contentType, resourceType) && !fullURL.endsWith("/")) {
|
||||||
|
fullURL += "/"
|
||||||
|
}
|
||||||
webDavFile = WebDavFile(
|
webDavFile = WebDavFile(
|
||||||
fullURL,
|
fullURL,
|
||||||
authorization,
|
authorization,
|
||||||
|
|||||||
@@ -16,7 +16,14 @@ class WebDavFile(
|
|||||||
) : WebDav(urlStr, authorization) {
|
) : WebDav(urlStr, authorization) {
|
||||||
|
|
||||||
val isDir by lazy {
|
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")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user