|
|
@ -160,11 +160,13 @@ class WebDav(urlStr: String) { |
|
|
|
if (url != null && auth != null) { |
|
|
|
if (url != null && auth != null) { |
|
|
|
//防止报错 |
|
|
|
//防止报错 |
|
|
|
return kotlin.runCatching { |
|
|
|
return kotlin.runCatching { |
|
|
|
|
|
|
|
if (!exists()) { |
|
|
|
okHttpClient.newCallResponseBody { |
|
|
|
okHttpClient.newCallResponseBody { |
|
|
|
url(url) |
|
|
|
url(url) |
|
|
|
method("MKCOL", null) |
|
|
|
method("MKCOL", null) |
|
|
|
addHeader("Authorization", Credentials.basic(auth.user, auth.pass)) |
|
|
|
addHeader("Authorization", Credentials.basic(auth.user, auth.pass)) |
|
|
|
}.close() |
|
|
|
}.close() |
|
|
|
|
|
|
|
} |
|
|
|
}.isSuccess |
|
|
|
}.isSuccess |
|
|
|
} |
|
|
|
} |
|
|
|
return false |
|
|
|
return false |
|
|
|