Browse Source

Create root directory in tar/zip files

Signed-off-by: Graham <gpe@openrs2.org>
master
Graham 2 months ago
parent
commit
da131000ba
  1. 3
      cache/src/main/kotlin/org/openrs2/cache/DiskStoreZipWriter.kt
  2. 5
      cache/src/main/kotlin/org/openrs2/cache/FlatFileStoreTarWriter.kt
  3. BIN
      cache/src/test/resources/org/openrs2/cache/disk-store-zip/cache.zip
  4. BIN
      cache/src/test/resources/org/openrs2/cache/flat-file-store-tar/cache.tar

3
cache/src/main/kotlin/org/openrs2/cache/DiskStoreZipWriter.kt

@ -42,6 +42,9 @@ public class DiskStoreZipWriter(
init {
out.setLevel(level)
out.putNextEntry(createZipEntry(""))
out.putNextEntry(createZipEntry("main_file_cache.dat2"))
out.write(zeroBlock)
}

5
cache/src/main/kotlin/org/openrs2/cache/FlatFileStoreTarWriter.kt

@ -24,6 +24,11 @@ public class FlatFileStoreTarWriter(
) : Store {
private val timestamp = Date.from(timestamp)
init {
out.putArchiveEntry(createTarEntry("", size = 0))
out.closeArchiveEntry()
}
private fun createTarEntry(name: String, size: Int): TarArchiveEntry {
val entry = TarArchiveEntry(prefix + name)
entry.modTime = timestamp

BIN
cache/src/test/resources/org/openrs2/cache/disk-store-zip/cache.zip

Binary file not shown.

BIN
cache/src/test/resources/org/openrs2/cache/flat-file-store-tar/cache.tar

Binary file not shown.
Loading…
Cancel
Save