You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, N5Factory.openReader and likely openWriter will fail if URI's with query and/or fragments are passed.
N5Reader n5 = new N5Factory().openReader("my-container.n5?img#fragment");
fails with
Exception in thread "main" org.janelia.saalfeldlab.n5.N5Exception$N5IOException: No container exists at my-container.n5?img#fragment
at org.janelia.saalfeldlab.n5.N5KeyValueReader.<init>(N5KeyValueReader.java:144)
This just means code that calls it is responsible for providing only the container part. Alternatively, N5Factory could handle that itself, for example by using N5URI.getContainerPath
The text was updated successfully, but these errors were encountered:
I vote for N5Factory handling it. It's unambiguous, and while we don't use it right now, potentially we could offer some N5Factory methods in the future that may benefit from that information. It should be straight forward to do.
1. strip the leading storage format scheme
2. get the schemeSpecificPart of the remaining URI
3. substring after the first ? if present (because the query is part of the schemeSpecificPart)
N5URI has some logic to handle this already. In fact, passing the resulting URI from 1. to N5URI and calling getContainerPath() should result in the desired output, the full URI up to the query.
Yup, what you describe does what I'd want and expect:
finalStringuri = ...
// remove format prefix if presentfinalPair<StorageFormat, URI> formatUri = N5Factory.StorageFormat.parseUri(uri);
// make the n5uri and get the container pathnewN5URI(formatUri.getB()).getContainerPath();
Currently,
N5Factory.openReader
and likelyopenWriter
will fail if URI's with query and/or fragments are passed.fails with
This just means code that calls it is responsible for providing only the container part. Alternatively, N5Factory could handle that itself, for example by using
N5URI.getContainerPath
The text was updated successfully, but these errors were encountered: