private static File getApplicationDirectoryLocation(String[] args) {
File path = getAppDirLocationFromCommandLine(args);
if (path == null) {
path = ApplicationDirectoryLocationPreference.get();
if (path == null || !path.exists() || !path.isDirectory()) {
AppDirLocationProvider locationProvider = ApplicationConfiguration.getAppDirLocationProvider();
path = locationProvider.getLocation();
ApplicationDirectoryLocationPreference.set(path);
}
}
return path;
}