Virtual File System - Metadata Support

I'm creating a custom language plugin and I have a need to store additional metadata about each source file (ie. what API version is associated with the file).  I've been reading about the Virtual File System (VFS) in IntelliJ here:

It states "Providing a possibility to associate additional persistent data with a file in the VFS."

Is this actually possible?  Is there an example of this in the CE of IDEA?  I've been looking at subclasses of com.intellij.openapi.vfs.VirtualFile, but I don't see anything.....

Would the best approach be to subclass VirtualFile and override the read/write methods so that the first xxx bytes contain my meta data (API version)?

If I do this, how do I tell IntelliJ to instantiate my subclass of VirtualFile when it reads a file of my FileType?

1 comment
Comment actions Permalink

Please check out com.intellij.openapi.vfs.newvfs.FileAttribute and/or com.intellij.openapi.roots.impl.FilePropertyPusher


Please sign in to leave a comment.