@@ -11,7 +11,7 @@ import java.nio.file.Files
11
11
import java.nio.file.Path
12
12
import java.nio.file.SimpleFileVisitor
13
13
import java.nio.file.attribute.BasicFileAttributes
14
- import kotlin.io.path.pathString
14
+ import kotlin.io.path.name
15
15
import kotlin.io.path.relativeTo
16
16
17
17
internal object CompressArchiveUtil {
@@ -73,7 +73,7 @@ internal object CompressArchiveUtil {
73
73
override fun preVisitDirectory (dir : Path , attrs : BasicFileAttributes ): FileVisitResult {
74
74
if (dir != basePath) {
75
75
tarArchiveOutputStream.putArchiveEntry(
76
- TarArchiveEntry (dir.relativeTo(basePath)),
76
+ TarArchiveEntry (dir.toFile(), dir. relativeTo(basePath).fileName.name ),
77
77
)
78
78
tarArchiveOutputStream.closeArchiveEntry()
79
79
}
@@ -82,7 +82,7 @@ internal object CompressArchiveUtil {
82
82
83
83
@Throws(IOException ::class )
84
84
override fun visitFile (file : Path , attrs : BasicFileAttributes ): FileVisitResult {
85
- addFileToTar(tarArchiveOutputStream, file, file.relativize (basePath).pathString )
85
+ addFileToTar(tarArchiveOutputStream, file, file.relativeTo (basePath).toString() )
86
86
return FileVisitResult .CONTINUE
87
87
}
88
88
0 commit comments