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

File paths are written to AASX with file:// URI scheme #258

Closed
andreas-schilling opened this issue Mar 6, 2024 · 4 comments · Fixed by #265
Closed

File paths are written to AASX with file:// URI scheme #258

andreas-schilling opened this issue Mar 6, 2024 · 4 comments · Fixed by #265

Comments

@andreas-schilling
Copy link
Contributor

Files that are written when serializing to AASX have their file path entry written with the file:// URI scheme, which breaks the ability to view the files using the AASX explorer, as it is an absolute file URI.
However, the file can't be written without the leading slash as well, because a part name has to start with a slash.
What is the exact reason, that files are converted to absolute file URIs during serialization? I can't think of any case where this would be correct in the context of an AASX, as the files are always within the archive and thus relative to the archive root (of course the AASX explorer could be changed to allow reading such URIs from the local archive root, but that sounds also not quite correct).

The code that performs the conversion is located here: https://github.com/eclipse-aas4j/aas4j/blob/main/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java#L251

If the file:// prefix is manually removed afterwards from the XML within the archive, accessing the file works.

@FrankSchnicke
Copy link
Contributor

Thanks for pointing out this issue with viewing in the AASX Package Explorer. We will discuss internally and update the ticket afterwards.

@FrankSchnicke
Copy link
Contributor

Would it be possible to double-check if your AASX now works correctly with the AASX Package Explorer by using the code of the attached PR?

@andreas-schilling
Copy link
Contributor Author

It does 👍

@FrankSchnicke
Copy link
Contributor

Perfect 👍 After review, it will be merged and included in the next release in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants