|
|
@ -35,8 +35,12 @@ object LocalBook { |
|
|
|
if (uri.isContentScheme()) { |
|
|
|
if (uri.isContentScheme()) { |
|
|
|
return appCtx.contentResolver.openInputStream(uri)!! |
|
|
|
return appCtx.contentResolver.openInputStream(uri)!! |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
val file = File(uri.path!!) |
|
|
|
|
|
|
|
if (file.exists()) { |
|
|
|
return FileInputStream(File(uri.path!!)) |
|
|
|
return FileInputStream(File(uri.path!!)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
throw FileNotFoundException("${uri.path} 文件不存在") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Throws(Exception::class) |
|
|
|
@Throws(Exception::class) |
|
|
|
fun getChapterList(book: Book): ArrayList<BookChapter> { |
|
|
|
fun getChapterList(book: Book): ArrayList<BookChapter> { |
|
|
|