@Test public void worksOnCurrentPlatformForBitcoinCore() { final String appName = "Bitcoin"; String path = AppDataDirectory.get(appName).toString(); if (Utils.isWindows()) { assertEquals("Path wrong on Windows", winPath(appName), path); } else if (Utils.isMac()) { assertEquals("Path wrong on Mac", macPath(appName), path); } else if (Utils.isLinux()) { assertEquals("Path wrong on Linux", unixPath(appName), path); } else { assertEquals("Path wrong on unknown/default", unixPath(appName), path); } }
public static Path get(String appName) { final Path applicationDataDirectory = getPath(appName); try { Files.createDirectories(applicationDataDirectory); } catch (IOException ioe) { throw new RuntimeException("Couldn't find/create AppDataDirectory", ioe); } return applicationDataDirectory; }
AppDataDirectory { public static Path get(String appName) { final Path applicationDataDirectory = getPath(appName); try { Files.createDirectories(applicationDataDirectory); } catch (IOException ioe) { throw new RuntimeException("Couldn't find/create AppDataDirectory", ioe); } return applicationDataDirectory; } }
AppDataDirectory { public static Path get(String appName) { final Path applicationDataDirectory = getPath(appName); try { Files.createDirectories(applicationDataDirectory); } catch (IOException ioe) { throw new RuntimeException("Couldn't find/create AppDataDirectory", ioe); } return applicationDataDirectory; }  }
AppDataDirectory { public static Path get(String appName) { final Path applicationDataDirectory = getPath(appName); try { Files.createDirectories(applicationDataDirectory); } catch (IOException ioe) { throw new RuntimeException("Couldn't find/create AppDataDirectory", ioe); } return applicationDataDirectory; }  static Path get(String appName); static Path getPath(String appName); }
AppDataDirectory { public static Path get(String appName) { final Path applicationDataDirectory = getPath(appName); try { Files.createDirectories(applicationDataDirectory); } catch (IOException ioe) { throw new RuntimeException("Couldn't find/create AppDataDirectory", ioe); } return applicationDataDirectory; }  static Path get(String appName); static Path getPath(String appName);  }