public FileSystem build( String name ) { Map<String, Object> vars = new HashMap<>(); if( watchService ) { vars.put( WATCH_SERVICE, true ); } if( closable ) { vars.put( CLOSABLE, true ); } if( maxSize > 0 ) { vars.put( MAX_SIZE, maxSize ); } vars.put( "roots", roots ); pathSpec.ifPresent( p -> vars.put( PATH_SPEC, p)); principals.ifPresent( p -> vars.put( "principals", p ) ); primaryStoreName.ifPresent( n -> vars.put( PRIMARY_STORE_NAME, n )); vars.put( ATTRIBUTE_VIEWS, attributeViews ); FileSystem fs = MemoryFSProvider.memoryUriMapper().getOrCreateFS( name, vars ); zipIn.ifPresent( z -> UnzipToPath.unzipToPath( z, fs.getPath( "" ).toAbsolutePath().getRoot())); return fs; }