mirror of
https://github.com/gotson/komga.git
synced 2025-12-06 08:32:25 +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("org.apache.tika:tika-core:1.22")
|
||||
implementation("net.lingala.zip4j:zip4j:2.1.2")
|
||||
implementation("com.github.junrar:junrar:4.0.0")
|
||||
implementation("net.grey-panther:natural-comparator:1.1")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
package org.gotson.komga.infrastructure.archive
|
||||
|
||||
import net.lingala.zip4j.ZipFile
|
||||
import org.springframework.stereotype.Service
|
||||
import java.io.InputStream
|
||||
import java.nio.file.Path
|
||||
import java.util.zip.ZipFile
|
||||
|
||||
@Service
|
||||
class ZipExtractor : ArchiveExtractor() {
|
||||
|
||||
override fun getFilenames(path: Path) =
|
||||
ZipFile(path.toFile()).fileHeaders
|
||||
ZipFile(path.toFile()).entries().toList()
|
||||
.filter { !it.isDirectory }
|
||||
.map { it.fileName }
|
||||
.map { it.name }
|
||||
.sortedWith(natSortComparator)
|
||||
|
||||
override fun getEntryStream(path: Path, entryName: String): InputStream =
|
||||
ZipFile(path.toFile()).let {
|
||||
it.getInputStream(it.getFileHeader(entryName))
|
||||
it.getInputStream(it.getEntry(entryName))
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue