Treat an archive (zip) as a read/write pseudo-directory?

Has anyone looked into what might be required to make the IDEA treat an archive under a source root as a pseudo-directory, i.e., allowing the archive to be browsed as if it were exploded into the filesystem and the archive contents to be edited in-place?  I know that library jars and zips can be perused this way for read-only purposes, but I'm talking about actually treating an archive under a source root exactly as if it were a directory.

My custom language plugin could benefit greatly from this given that the target environment supports zip-based static resource bundles that are curently recognized properly as zip archives but are basically opaque blobs in the IDE.

Anyone have pointers to existing work/thoughts on this?  Thanks much!

0
2 comments

This shouldn't be too diffficult to implement, but the key question is how exactly you want to update the archive when files are changed. Repacking the enitre archive on every write operation is unlikely to deliver satisfactory performance, so you'll most likely need some intermediate file-based store where you save changes before you can update the archive.

0

Agreed.  I've been debating whether a better approach (for my plugin at least) might be to explode the archive into the source root while working with it and then pack it for build/deployment.  The files that would be treated this way could be selected either automatically based on file type or explicitly by the user as part of configuration.  Of course, I'd have to figure out how to get the IDE to ignore the files from the exploded archive for purposes of VCS, etc.  I guess the virtual file system could provide some encapsulation of this behavior if properly implemented, though.

Okay, that's definitely food for thought.  Nothing I'll be working on in the immediate future, but something to consider.  Thanks!

0

Please sign in to leave a comment.