Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space in file path causes IllegalArgumentException #39

Open
marpet opened this issue Apr 3, 2023 · 1 comment · Fixed by zarr-developers/jzarr#9 · May be fixed by #40
Open

Space in file path causes IllegalArgumentException #39

marpet opened this issue Apr 3, 2023 · 1 comment · Fixed by zarr-developers/jzarr#9 · May be fixed by #40
Assignees
Labels
bug Something isn't working

Comments

@marpet
Copy link
Contributor

marpet commented Apr 3, 2023

When a file path is converted to an URL in order to read a zipped ZNAP file in SNAP an IllegalArgumentException is thrown if this path contains a space.

java.net.URISyntaxException: Illegal character in opaque part at index 71: jar:file:/C:/Users/<snip>/RSEO content/S2A_MSIL2A_20230227T160221_N0509_R097_T17QLF_20230227T225659_subset20m.znap.zip at java.net.URI$Parser.fail(URI.java:2848) at java.net.URI$Parser.checkChars(URI.java:3021) at java.net.URI$Parser.parse(URI.java:3058) at java.net.URI.<init>(URI.java:588) at java.net.URI.create(URI.java:850) Caused: java.lang.IllegalArgumentException: Illegal character in opaque part at index 71: jar:file:/C:/Users/<snip>/RSEO content/S2A_MSIL2A_20230227T160221_N0509_R097_T17QLF_20230227T225659_subset20m.znap.zip at java.net.URI.create(URI.java:852) at com.bc.zarr.storage.ZipStore.<init>(ZipStore.java:57) at org.esa.snap.dataio.znap.ZnapProductWriter.writeProductNodesImpl(ZnapProductWriter.java:255) at org.esa.snap.core.dataio.AbstractProductWriter.writeProductNodes(AbstractProductWriter.java:111)

Before the JAR URI is created the URL needs probably be decoded.

@marpet marpet added the bug Something isn't working label Apr 3, 2023
@marpet marpet self-assigned this Apr 3, 2023
@marpet marpet linked a pull request Apr 3, 2023 that will close this issue
@marpet marpet assigned SabineEmbacher and unassigned marpet Apr 3, 2023
@marpet
Copy link
Contributor Author

marpet commented Apr 3, 2023

This relates to the issue in SNAP:
https://senbox.atlassian.net/jira/software/c/projects/SNAP/issues/SNAP-3487

joshmoore added a commit to zarr-developers/jzarr that referenced this issue Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants