/** * Returns a default configuration appropriate to the current operating system. * * <p>More specifically, if the operating system is Windows, {@link Configuration#windows()} is * returned; if the operating system is Mac OS X, {@link Configuration#osX()} is returned; * otherwise, {@link Configuration#unix()} is returned. * * <p>This is the configuration used by the {@code Jimfs.newFileSystem} methods that do not take * a {@code Configuration} parameter. * * @since 1.1 */ public static Configuration forCurrentPlatform() { String os = System.getProperty("os.name"); if (os.contains("Windows")) { return windows(); } else if (os.contains("OS X")) { return osX(); } else { return unix(); } }
@Parameters(name = "os = {0}") public static Collection<Object[]> data() { return Arrays.asList( new Object[][] { {"Unix", Configuration.unix(), "/usr/home/android/sdk", ""}, {"Windows", Configuration.windows(), "C:\\android\\sdk", ".exe"}, {"OS X", Configuration.osX(), "/Users/home/android/sdk", ""} }); }
/** * Replace the file system configuration with one that mimics Windows. */ public FileSystemBuilder asWindows() { config = Configuration.windows().toBuilder(); return this; }
/** * Returns a default configuration appropriate to the current operating system. * * <p>More specifically, if the operating system is Windows, {@link Configuration#windows()} is * returned; if the operating system is Mac OS X, {@link Configuration#osX()} is returned; * otherwise, {@link Configuration#unix()} is returned. * * <p>This is the configuration used by the {@code Jimfs.newFileSystem} methods that do not take * a {@code Configuration} parameter. * * @since 1.1 */ public static Configuration forCurrentPlatform() { String os = System.getProperty("os.name"); if (os.contains("Windows")) { return windows(); } else if (os.contains("OS X")) { return osX(); } else { return unix(); } }