Skip to content

Difficulty creating a new .ozx file with BufferedZipStore #72

@melissalinkert

Description

@melissalinkert

Using 0.1.2 and this test code:

import java.util.Arrays;
import dev.zarr.zarrjava.store.BufferedZipStore;
import dev.zarr.zarrjava.v3.Array;
import dev.zarr.zarrjava.v3.ArrayMetadata;
import dev.zarr.zarrjava.v3.DataType;

public class ZipTest {

  public void writeTestZip(String outputPath) throws Exception {
    BufferedZipStore store = new BufferedZipStore(outputPath);
  }

  public static void main(String[] args) throws Exception {
    new ZipTest().writeTestZip(args[0]);
  }
}

and running with java ZipTest test.ozx, I see this exception:

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.resolve(String)" because "newPath" is null
	at dev.zarr.zarrjava.store.FilesystemStore.resolveKeys(FilesystemStore.java:31)
	at dev.zarr.zarrjava.store.FilesystemStore.getSize(FilesystemStore.java:232)
	at dev.zarr.zarrjava.store.StoreHandle.getSize(StoreHandle.java:84)
	at dev.zarr.zarrjava.store.ZipStore.getArchiveComment(ZipStore.java:48)
	at dev.zarr.zarrjava.store.BufferedZipStore.loadBuffer(BufferedZipStore.java:199)
	at dev.zarr.zarrjava.store.BufferedZipStore.<init>(BufferedZipStore.java:57)
	at dev.zarr.zarrjava.store.BufferedZipStore.<init>(BufferedZipStore.java:67)
	at dev.zarr.zarrjava.store.BufferedZipStore.<init>(BufferedZipStore.java:75)
	at dev.zarr.zarrjava.store.BufferedZipStore.<init>(BufferedZipStore.java:83)
	at dev.zarr.zarrjava.store.BufferedZipStore.<init>(BufferedZipStore.java:91)
	at dev.zarr.zarrjava.store.BufferedZipStore.<init>(BufferedZipStore.java:95)
	at ZipTest.writeTestZip(ZipTest.java:12)
	at ZipTest.main(ZipTest.java:16)

Is there an alternate way to open for writing a zip file that doesn't already exist?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions