IntelliJ Community . PluginDevelopmentHowTo00004

 
PluginDevelopmentHowTo00004 

HOME INDEX SEARCH CHANGES GO  

PluginDevelopmentHowTo00004

Problem description

Get the VirtualFile? from absolute file path.

Problem resolution

From SystemToolsPlugin sources:

    public VirtualFile getVirtualFile() {
        VirtualFileSystem fileSystem = LocalFileSystem.getInstance();
        return fileSystem.findFileByPath(fileContext.getFile().getAbsolutePath().replace(File.separatorChar, '/'));
    }

Related Topics: PluginDevelopmentHowTo, PluginDocumentation, ProjectPluginTemplate, OpenAPI, IntellijPluginDocumentation, IntellijPluginDocumentation, PluginDeployment, IdeasForPlugins

-- AlexeyEfimov - 15 Feb 2005

PluginDevelopmentHowToForm
HowToQuestion: How to get VirtualFile? by absolute file path
OpenAPI: VFS
HowToStatus?: choice-yes.gif

e d i t a t t a c h r e f - b y d i f f s m o r e
Have ideas, requests, problems regarding this site? Send feedback.
Copyright © 2000-2003 by the contributing authors. All materials at intellij.org are the property of the contributing authors.