Implementation of Assembled VirtualFileHandlers
Apart from files, directories (FileHandler) and zip archives (ZipEntryHandler) the Microcontainer also supports other more advanced use cases. The first one is Assembled, which is similar to what Eclipse calls Linked Resources. Its purpose is to take existing resources from different trees, and "mock" them into single resource tree. Example 8.6. Implementation of Assembled VirtualFileHandlers AssembledDirectory sar = AssembledContextFactory.getInstance().create("assembled.sar"); URL url = getResource("/vfs/test/jar1.jar"); VirtualFile jar1 = VFS.getRoot(url); sar.addChild(jar1); url = getResource("/tmp/app/ext.jar"); VirtualFile ext1 = VFS.getRoot(url); sar.addChild(ext); AssembledDirectory metainf = sar.mkdir("META-INF"); url = getResource("/config/jboss-service.xml"); VirtualFile serviceVF = VFS.getRoot(url); metainf.addChild(serviceVF); AssembledDirectory app = sar.mkdir("app.jar"); url = getResource("/app/someapp/classes"); VirtualFile appVF = VFS.getRoot(url); app.addPath(appVF, new SuffixFilter(".class"));