优化
This commit is contained in:
@@ -172,14 +172,11 @@ open class WebDav(val path: String, val authorization: Authorization) {
|
|||||||
*/
|
*/
|
||||||
suspend fun exists(): Boolean {
|
suspend fun exists(): Boolean {
|
||||||
return kotlin.runCatching {
|
return kotlin.runCatching {
|
||||||
val requestPropsStr = DIR.replace("%s", "")
|
|
||||||
return okHttpClient.newCallResponse {
|
return okHttpClient.newCallResponse {
|
||||||
url(url)
|
url(url)
|
||||||
addHeader(authorization.name, authorization.data)
|
addHeader(authorization.name, authorization.data)
|
||||||
addHeader("Depth", "0")
|
head()
|
||||||
val requestBody = requestPropsStr.toRequestBody("application/xml".toMediaType())
|
}.code == 200
|
||||||
method("PROPFIND", requestBody)
|
|
||||||
}.code == 207
|
|
||||||
}.getOrDefault(false)
|
}.getOrDefault(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user