List of usage examples for com.google.common.jimfs Configuration windows
public static Configuration windows()
Returns the default configuration for a Windows-like file system.
From source file:com.facebook.buck.io.filesystem.impl.FakeProjectFilesystem.java
public static ProjectFilesystem createJavaOnlyFilesystem(String rootPath) { boolean isWindows = Platform.detect() == Platform.WINDOWS; Configuration configuration = isWindows ? Configuration.windows() : Configuration.unix(); rootPath = isWindows ? "C:" + rootPath : rootPath; FileSystem vfs = Jimfs.newFileSystem(configuration.toBuilder().setAttributeViews("basic", "posix").build()); Path root = vfs.getPath(rootPath); try {// ww w. j a va2 s . c o m Files.createDirectories(root); } catch (IOException e) { throw new RuntimeException(e); } return new DefaultProjectFilesystem(root, new DefaultProjectFilesystemDelegate(root), DefaultProjectFilesystemFactory.getWindowsFSInstance()) { @Override public Path resolve(Path path) { // Avoid resolving paths from different Java FileSystems. return resolve(path.toString()); } }; }