|
|
@ -35,7 +35,7 @@ class CacheViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun export(doc: DocumentFile, book: Book) { |
|
|
|
private fun export(doc: DocumentFile, book: Book) { |
|
|
|
val filename = "${book.name} 作者:${book.author}.txt" |
|
|
|
val filename = "${book.name} by ${book.author}.txt" |
|
|
|
val content = getAllContents(book) |
|
|
|
val content = getAllContents(book) |
|
|
|
DocumentUtils.createFileIfNotExist(doc, filename) |
|
|
|
DocumentUtils.createFileIfNotExist(doc, filename) |
|
|
|
?.writeText(context, content) |
|
|
|
?.writeText(context, content) |
|
|
@ -73,7 +73,7 @@ class CacheViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun export(file: File, book: Book) { |
|
|
|
private fun export(file: File, book: Book) { |
|
|
|
val filename = "${book.name} 作者:${book.author}.txt" |
|
|
|
val filename = "${book.name} by ${book.author}.txt" |
|
|
|
FileUtils.createFileIfNotExist(file, filename) |
|
|
|
FileUtils.createFileIfNotExist(file, filename) |
|
|
|
.writeText(getAllContents(book)) |
|
|
|
.writeText(getAllContents(book)) |
|
|
|
WebDavHelp.exportWebDav(file.absolutePath, filename)//导出到webdav |
|
|
|
WebDavHelp.exportWebDav(file.absolutePath, filename)//导出到webdav |
|
|
|