2929import com .google .cloud .storage .Storage ;
3030import com .google .cloud .storage .StorageOptions ;
3131import com .google .gson .GsonBuilder ;
32- import com .sun .tools .javac .util .List ;
3332import net .imglib2 .util .Pair ;
3433import org .apache .commons .lang3 .function .TriFunction ;
3534import org .janelia .saalfeldlab .googlecloud .GoogleCloudUtils ;
3635import org .janelia .saalfeldlab .n5 .FileSystemKeyValueAccess ;
3736import org .janelia .saalfeldlab .n5 .KeyValueAccess ;
3837import org .janelia .saalfeldlab .n5 .N5Exception ;
38+ import org .janelia .saalfeldlab .n5 .N5Exception .N5IOException ;
3939import org .janelia .saalfeldlab .n5 .N5KeyValueReader ;
4040import org .janelia .saalfeldlab .n5 .N5KeyValueWriter ;
4141import org .janelia .saalfeldlab .n5 .N5Reader ;
5959import java .net .URISyntaxException ;
6060import java .nio .file .Paths ;
6161import java .util .Arrays ;
62+ import java .util .List ;
6263import java .util .function .BiFunction ;
6364import java .util .function .Consumer ;
6465import java .util .regex .Pattern ;
@@ -452,13 +453,13 @@ public N5Reader openReader(@Nullable final StorageFormat storage, @Nullable fina
452453 * @return an N5Reader
453454 */
454455 private N5Reader newGenericZarrReader (final KeyValueAccess access , final URI location ) {
455- for (StorageFormat zarrFormat : List . of (ZARR3 , ZARR2 )) {
456+ for (StorageFormat zarrFormat : Arrays . asList (ZARR3 , ZARR2 )) {
456457 try {
457458 return openReader (zarrFormat , access , location );
458459 } catch (Exception ignored ) {
459460 }
460461 }
461- throw new N5Exception ("Unable to open Zarr reader at " + location .toString () + " as N5Reader" );
462+ throw new N5IOException ("Unable to open Zarr reader at " + location .toString () + " as N5Reader" );
462463 }
463464
464465 /**
@@ -683,7 +684,7 @@ public N5Writer openWriter(@Nullable final StorageFormat storage, @Nullable fina
683684 * @return the zarr writer
684685 */
685686 private N5Writer newGenericZarrWriter (final KeyValueAccess access , final URI location ) {
686- List <StorageFormat > zarrFormats = List . of (ZARR3 , ZARR2 );
687+ List <StorageFormat > zarrFormats = Arrays . asList (ZARR3 , ZARR2 );
687688 for (StorageFormat zarrFormat : zarrFormats ) {
688689 /* we dont care about the read, but we do want to prefer a writer over a container that
689690 * exists, rather than creating a new writer; the only way to check is to see if
@@ -701,7 +702,7 @@ private N5Writer newGenericZarrWriter(final KeyValueAccess access, final URI loc
701702 }
702703 }
703704
704- throw new N5Exception ("Unable to open Zarr writer at " + location .toString () + " as N5Reader" );
705+ throw new N5IOException ("Unable to open Zarr writer at " + location .toString () + " as N5Reader" );
705706 }
706707
707708 private <T extends N5Reader > T openN5ContainerWithStorageFormat (
0 commit comments