Guidance on creating custom ArchiveFileSystem


What would be the steps to create a custom FileSystem (similar to JarFileSystem)?

For example, I might have an archive of binary files added as a library to the project (similar to JAR). And I want to have support for that archive type similar to jar type: correct class resolution based on path to binaries, archive is expandable in a file tree window, etc.

Tbh, I have no idea where to start. I've read the docs about VirtualSystem, it's a high-level overview, so I still not sure if I need to implement a number of classes, use some extension points, or invoke any IJ API.

Could someone explain to me the steps needed to create a custom FileSystem? Any help is appreciated!

Comment actions Permalink

Implement your custom FileSystem by extending base class com.intellij.openapi.vfs.newvfs.ArchiveFileSystem and register it in extension point com.intellij.virtualFileSystem.

You can find a number of VFS System implementations in IJ Community sources or in 3rd party plugins:

Resolving classes really depends on how these files are setup in project model/roots. It's possible to provide custom com.intellij.psi.NonClasspathClassFinder extension.

Comment actions Permalink

Posting an update for anyone looking into implementing FileSystem. Extending ArchiveFileSystem is not enough. I asked a follow-up question here, and the answer was to also implement new FileType:


Please sign in to leave a comment.