Even that does not seem to work. While specifiying the URL, I will have to prepend the path with 'file:///', right? I tried without 'file:///' and with 'file:///', however it did not work.
I am implementing a VCS plugin. Plugin provides a search wherein deleted files are shown (those not present on file system, but alive in the repository). When I perform right click in the searhes view, I obtain the absolute path of the file. Using this path, I want the VirtualFile object to decide the which actions should be enabled or disabled.
I am implementing a VCS plugin. Plugin provides a search wherein deleted files are shown (those not present on file system, but alive in the repository). When I perform right click in the searhes view, I obtain the absolute path of the file. Using this path, I want the VirtualFile object to decide the which actions should be enabled or disabled.
Hope this makes clear.
Hmm, I'm not familiar with the VCS APIs, but I still don't understand what exactly you need the VirtualFile for. If you need it because of some other API dependency, you should be able to create you own VirtualFile implementation that represents the file in your VCS.
I was able to get the FilePath object. However I need VirtualFile object. Is there no way to do this?
Well, you can try to provide your own VirtualFileSystem implementation and return VirtualFiles from that filesystem for files which don't exist in the real filesystem. However, the correct (and much simpler) solution for your problem is indeed, as has already been recommended, to use FilePath objects instead of VirtualFile.
-- Dmitry Jemerov Development Lead JetBrains, Inc. http://www.jetbrains.com/ "Develop with Pleasure!"
Try this
Hi Alex,
Even that does not seem to work. While specifiying the URL, I will have to prepend the path with 'file:///', right? I tried without 'file:///' and with 'file:///', however it did not work.
Thanks
Devang Shah
Devang Shah wrote:
As far as I know, you cannot get VF objects for non-existing files. What do you need it for?
Sascha
Hi,
I am implementing a VCS plugin. Plugin provides a search wherein deleted files are shown (those not present on file system, but alive in the repository). When I perform right click in the searhes view, I obtain the absolute path of the file. Using this path, I want the VirtualFile object to decide the which actions should be enabled or disabled.
Hope this makes clear.
Thanks
Devang Shah
AFAIK, the previous poster is right, VirtualFile are null for non existing files.
You should be able to create a FilePath for it though, would that be enough for you ?
Hi,
I was able to get the FilePath object. However I need VirtualFile object. Is there no way to do this?
Thanks
Devang Shah
Devang Shah wrote:
Hmm, I'm not familiar with the VCS APIs, but I still don't understand what exactly you need the
VirtualFile for. If you need it because of some other API dependency, you should be able to create
you own VirtualFile implementation that represents the file in your VCS.
Sascha
Hello Devang,
Well, you can try to provide your own VirtualFileSystem implementation and
return VirtualFiles from that filesystem for files which don't exist in the
real filesystem. However, the correct (and much simpler) solution for your
problem is indeed, as has already been recommended, to use FilePath objects
instead of VirtualFile.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"