final String spUserdir = "user.dir";
final String path = PreferencesUtils.getSystemValue(FilePreferencesFactory.ENV_PROP_PREFS_PATH, spUserdir);
if (path == null) {
throw new BackingStoreException(
"No back store found for FilePreferencesApi. Please configure -D" +
FilePreferencesFactory.ENV_PROP_PREFS_PATH +
" on JVM");
}
if (path.endsWith("\\true")) {
System.out.println("-Duser.dir: " + System.getProperty("user.dir"));
System.out.println("-D" + FilePreferencesFactory.ENV_PROP_PREFS_PATH + ": " + System.getProperty(FilePreferencesFactory.ENV_PROP_PREFS_PATH));
System.out.println("path: " + path);
}
final File res = new File(path);
if (!res.exists()) {
throw new BackingStoreException(
"The path " +
res.getAbsolutePath() +
" does not exists.");
}
if (!res.isDirectory()) {
throw new BackingStoreException(
"The path " +
path +
" is not a directory.");
}