I am working on plugin in on IntelliJ.
Now I have a VirtualFile file
, I am trying to write file.getUrl()
to local file system so that I can get file
back when I restart my plugin. But It seems I can not get the VirtualFile
from a url
?
To find a file by URL, use VirtualFileManager.findFileByUrl()
(source). Or keep things simple, store the path and use LocalFileSystem.findFileByPath()
as suggested by @vikingsteve.