How can i refresh FilenameIndex immediately?

In my plugin, I created a file using VirtualFile.createChildData method..

Just after creating a file, I checked current project have some files that have *.abc extension. (for any reason..)

In this case, I used FilenameIndex.getAllFilesByExt method, but is returns 0 length collection.

 

I think, in this case, file is successfully created, but it has not been indexed yet, right?

So, I think that there are two solutions : 1) force trigger indexing for that file or 2) manually add to index when creating a file.

 

How can i do that?

Thanks in advance.

Please sign in to leave a comment.