class DataDirectoryLocator {

	public File locate() {
		String os = System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
		String path;
		if (os.contains("mac")) {
			path = System.getProperty("user.home") + "/Library/Application Support/" + APP_DIR;
		} else if (os.contains("windows")) {
			String appData = System.getenv("APPDATA");
			if (Strings.isNullOrEmpty(appData)) {
				appData = System.getProperty("user.home") + "AppData\\Roaming";
			}
			path = appData + "\\" + APP_DIR;
		} else {
			throw new IllegalStateException(os);
		}
		if (Demo.isEnabled()) {
			path += "-demo";
		}
		return new File(path);
	}

}