I implemented VirtualFileListener in a Component and in its fileCreated() method I need to know the root path for the module where the file is created. My code is:
Module module = ProjectRootManager.getInstance(MyComponent.this.myProject).getFileIndex().getModuleForFile(event.getFile());
For some reason it returns null. Is it a bug or is it by design? And is there any alternative way to get the Module content path?