mirror of
https://github.com/mihonapp/mihon.git
synced 2025-07-11 10:15:11 +02:00
Address ZipFile
deprecation warning
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
package eu.kanade.tachiyomi.util.storage
|
||||
|
||||
import mihon.core.common.extensions.toZipFile
|
||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry
|
||||
import org.apache.commons.compress.archivers.zip.ZipFile
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
import java.io.Closeable
|
||||
@ -17,7 +17,7 @@ class EpubFile(channel: SeekableByteChannel) : Closeable {
|
||||
/**
|
||||
* Zip file of this epub.
|
||||
*/
|
||||
private val zip = ZipFile(channel)
|
||||
private val zip = channel.toZipFile()
|
||||
|
||||
/**
|
||||
* Path separator used by this epub.
|
||||
|
@ -0,0 +1,8 @@
|
||||
package mihon.core.common.extensions
|
||||
|
||||
import org.apache.commons.compress.archivers.zip.ZipFile
|
||||
import java.nio.channels.SeekableByteChannel
|
||||
|
||||
fun SeekableByteChannel.toZipFile(): ZipFile {
|
||||
return ZipFile.Builder().setSeekableByteChannel(this).get()
|
||||
}
|
Reference in New Issue
Block a user