List of usage examples for com.google.common.jimfs Jimfs newFileSystem
@VisibleForTesting
static FileSystem newFileSystem(URI uri, Configuration config)
From source file:org.fao.geonet.FileSystemPool.java
public synchronized CreatedFs get(String fsId) throws IOException { while (openFs > MAX_FS && pool.isEmpty()) { try {/* www.ja va2 s . com*/ this.wait(1000); } catch (InterruptedException e) { Jimfs.newFileSystem(fsId, Configuration.unix()); } } final CreatedFs fileSystem; if (pool.isEmpty()) { openFs++; fileSystem = new CreatedFs(Jimfs.newFileSystem(fsId, Configuration.unix()), "nodes", "default_data_dir"); } else { fileSystem = pool.pop(); org.junit.Assert.assertNotNull(fileSystem); } syncWithTemplate(fileSystem); IO.setFileSystemThreadLocal(fileSystem.fs); return fileSystem; }