Canonical, stable, file reference

In my plugin I have a class (LogResourceBundle) which wraps an existing source file (a properties file) and provides operations to the rest of the plugin to manipulate and query this file. There is a one-to-one mapping of LogResourceBundle instance to properties file.

For each instance of LogResourceBundle to retain a reference to its properties file, should it be keeping a reference to the PsiFile or to the VirtualFile? In other words, should I be retaining a VirtualFile reference and looking up the PsiFile every time an operation is performed on my LogResourceBundle?

Please sign in to leave a comment.