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