public String getRelativeApplicationDataDir(String applicationName) { return getRelativeApplicationDataDir(applicationName, dataDirPreserveCase(), dataDirReplaceWhitespace(), dataDirReplaceColon()); }
public final File getApplicationDataDir(String applicationName) { return new File(getApplicationDataDir(), getRelativeApplicationDataDir(applicationName)); }
public final File getOSApplicationDataDir(String applicationName) { return new File(getOSApplicationDataDir(), getRelativeApplicationDataDir(applicationName)); }
public final File getApplicationDataDir() { File result; String sysProp; if ((sysProp = System.getProperty(APPDATA_BASEDIR_PROPERTY)) != null) { result = new File(sysProp); } else if ((sysProp = System.getProperty(OLD_DATADIR_PROPERTY)) != null) { logger.info( "Old Aduna datadir property \"{}\" detected. This property has been replaced with \"{}\". " + "Support for the old property may be removed in a future version of this application.", OLD_DATADIR_PROPERTY, APPDATA_BASEDIR_PROPERTY); result = new File(sysProp); } else { result = getOSApplicationDataDir(); } return result; }
public File getUserHome() { File result = super.getUserHome(); String homeDrive = System.getenv("HOMEDRIVE"); String homePath = System.getenv("HOMEPATH"); if (homeDrive != null && homePath != null) { File homeDir = new File(homeDrive + homePath); if (homeDir.isDirectory() && homeDir.canWrite()) { result = homeDir; } } else { String userProfile = System.getenv("USERPROFILE"); if (userProfile != null) { File userProfileDir = new File(userProfile); if (userProfileDir.isDirectory() && userProfileDir.canWrite()) { result = userProfileDir; } } } return result; }