mirror of
https://github.com/gotson/komga.git
synced 2025-12-21 07:56:57 +01:00
fix(zip extractor): better handling of exotic charsets
replacement of java.util.zip.ZipFile by org.apache.commons.compress.archivers.zip.ZipFile closes #41
This commit is contained in:
parent
fcfe78b7be
commit
0254d7d867
2 changed files with 4 additions and 3 deletions
|
|
@ -66,6 +66,7 @@ dependencies {
|
|||
implementation("org.apache.commons:commons-lang3:3.9")
|
||||
|
||||
implementation("org.apache.tika:tika-core:1.23")
|
||||
implementation("org.apache.commons:commons-compress:1.19")
|
||||
implementation("com.github.junrar:junrar:4.0.0")
|
||||
implementation("org.apache.pdfbox:pdfbox:2.0.17")
|
||||
implementation("net.grey-panther:natural-comparator:1.1")
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package org.gotson.komga.infrastructure.archive
|
||||
|
||||
import org.apache.commons.compress.archivers.zip.ZipFile
|
||||
import org.gotson.komga.domain.model.BookPage
|
||||
import org.springframework.stereotype.Service
|
||||
import java.nio.file.Path
|
||||
import java.util.zip.ZipFile
|
||||
|
||||
@Service
|
||||
class ZipExtractor(
|
||||
|
|
@ -12,7 +12,7 @@ class ZipExtractor(
|
|||
|
||||
override fun getPagesList(path: Path): List<BookPage> =
|
||||
ZipFile(path.toFile()).use { zip ->
|
||||
zip.entries().toList()
|
||||
zip.entries.toList()
|
||||
.filter { !it.isDirectory }
|
||||
.map {
|
||||
BookPage(
|
||||
|
|
@ -27,4 +27,4 @@ class ZipExtractor(
|
|||
ZipFile(path.toFile()).use {
|
||||
it.getInputStream(it.getEntry(entryName)).readBytes()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue