pull/981/head 3.21.051020
gedoor 4 years ago
parent feba6cb797
commit 7d67ae2e85
  1. 10
      app/src/main/java/io/legado/app/lib/webdav/WebDav.kt

@ -63,17 +63,19 @@ class WebDav(urlStr: String) {
/**
* 列出当前路径下的文件
*
* @param propsList 指定列出文件的哪些属性
* @return 文件列表
*/
suspend fun listFiles(propsList: ArrayList<String> = ArrayList()): List<WebDav> {
propFindResponse(propsList)?.let { body ->
suspend fun listFiles(): List<WebDav> {
propFindResponse()?.let { body ->
return parseDir(body)
}
return ArrayList()
}
private suspend fun propFindResponse(propsList: ArrayList<String>): String? {
/**
* @param propsList 指定列出文件的哪些属性
*/
private suspend fun propFindResponse(propsList: List<String> = emptyList()): String? {
val requestProps = StringBuilder()
for (p in propsList) {
requestProps.append("<a:").append(p).append("/>\n")

Loading…
Cancel
Save