FilePath (@NotNull VFileEvent event) { if (event instanceof VFileCreateEvent createEvent) { return VcsUtil.getFilePath(event.getPath(), createEvent.isDirectory()); } VirtualFile file = event.getFile(); if (file != null) { // Do not use file.getPath(), as it is slower. return VcsUtil.getFilePath(event.getPath(), file.isDirectory()); } else { LOG.error("VFileEvent should have VirtualFile: " + event); return VcsUtil.getFilePath(event.getPath()); } }