A general question and one more specific question
- In monolith mode, what’s the recommendation to reference a VirtualFile?
- May
VirtualFileUrlbe used only forWorkspace-related files or is a more generic use okay? - Should
VirtualFileIdonly be used for RPC-aware APIs or is more generic use okay? - What’s the downside of the plain
VirtualFile.getUrl()? Lookup performance or something else?
- Question related to split mode:
In a plugin, which is capable of split mode, I need to store a reference to a VirtualFile.
The file is on the backend, but to pass state between frontend and backend, it must be serializable. The file will be read only a few times and not regularly.
It must:
- be serializable via RPC, for split-mode
- not keep a strong reference to the VirtualFile (to avoid leaks and to reference potentially invalid files)
If I understand correctly, aVirtualFileIdkeeps a strong reference in monolith mode.
AndVirtualFileUrlis (probably) not serializable.
That would leave “VirtualFile.getUrl()”, even though I’d prefer the newer alternatives.
Any recommendations on the best way to handle VirtualFiles?