public static Closeable mountZipExpanded ( File zipFile , VirtualFile mountPoint , TempFileProvider tempFileProvider ) throws IOException { boolean ok = false ; final TempDir tempDir = tempFileProvider . createTempDir ( zipFile . getName ( ) ) ; try { final File rootFile = tempDir . getRoot ( ) ; VFSUtils . unzip ( zipFile , rootFile ) ; final MountHandle handle = doMount ( new RealFileSystem ( rootFile ) , mountPoint , tempDir ) ; ok = true ; return handle ; } finally { if ( ! ok ) { VFSUtils . safeClose ( tempDir ) ; } } }
Create and mount an expanded zip file in a temporary file system returning a single handle which will unmount and close the filesystem when closed .