String (String selector, String macDir, String macSub, String winVar, String winSub, String xdgVar, String xdgDfl, String xdgSub) { String userHome = System.getProperty("user.home"); String vendorName = vendorName(); if (SystemInfoRt.isMac) { String dir = userHome + "/Library/" + macDir + '/' + vendorName; if (!selector.isEmpty()) dir = dir + '/' + selector; if (!macSub.isEmpty()) dir = dir + '/' + macSub; return dir; } if (SystemInfoRt.isWindows) { String dir = System.getenv(winVar); if (dir == null || dir.isEmpty()) dir = userHome + "\\AppData\\" + (winVar.startsWith("LOCAL") ? "Local" : "Roaming"); dir = dir + '\\' + vendorName; if (!selector.isEmpty()) dir = dir + '\\' + selector; if (!winSub.isEmpty()) dir = dir + '\\' + winSub; return dir; } if (SystemInfoRt.isUnix) { return getUnixPlatformPath(userHome, selector, xdgVar, xdgDfl, xdgSub); } throw new UnsupportedOperationException("Unsupported OS: " + SystemInfoRt.OS_NAME); }