mirror of
https://github.com/gotson/komga.git
synced 2025-12-06 16:42:24 +01:00
use java.util.zip instead of zip4j
This commit is contained in:
parent
3c4d1b3c28
commit
77b691e49d
2 changed files with 4 additions and 5 deletions
|
|
@ -55,7 +55,6 @@ dependencies {
|
||||||
implementation("commons-io:commons-io:2.6")
|
implementation("commons-io:commons-io:2.6")
|
||||||
|
|
||||||
implementation("org.apache.tika:tika-core:1.22")
|
implementation("org.apache.tika:tika-core:1.22")
|
||||||
implementation("net.lingala.zip4j:zip4j:2.1.2")
|
|
||||||
implementation("com.github.junrar:junrar:4.0.0")
|
implementation("com.github.junrar:junrar:4.0.0")
|
||||||
implementation("net.grey-panther:natural-comparator:1.1")
|
implementation("net.grey-panther:natural-comparator:1.1")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,21 @@
|
||||||
package org.gotson.komga.infrastructure.archive
|
package org.gotson.komga.infrastructure.archive
|
||||||
|
|
||||||
import net.lingala.zip4j.ZipFile
|
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
import java.util.zip.ZipFile
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
class ZipExtractor : ArchiveExtractor() {
|
class ZipExtractor : ArchiveExtractor() {
|
||||||
|
|
||||||
override fun getFilenames(path: Path) =
|
override fun getFilenames(path: Path) =
|
||||||
ZipFile(path.toFile()).fileHeaders
|
ZipFile(path.toFile()).entries().toList()
|
||||||
.filter { !it.isDirectory }
|
.filter { !it.isDirectory }
|
||||||
.map { it.fileName }
|
.map { it.name }
|
||||||
.sortedWith(natSortComparator)
|
.sortedWith(natSortComparator)
|
||||||
|
|
||||||
override fun getEntryStream(path: Path, entryName: String): InputStream =
|
override fun getEntryStream(path: Path, entryName: String): InputStream =
|
||||||
ZipFile(path.toFile()).let {
|
ZipFile(path.toFile()).let {
|
||||||
it.getInputStream(it.getFileHeader(entryName))
|
it.getInputStream(it.getEntry(entryName))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue