in taverna-app-configuration-impl/src/main/java/org/apache/taverna/configuration/app/impl/ApplicationConfigurationImpl.java [102:124]
public synchronized Path getApplicationHomeDir() {
if (homeDir == null) {
if (getName().equals(ApplicationConfigurationImpl.UNKNOWN_APPLICATION)) {
try {
// Make a temporary home directory as a backup
homeDir = File.createTempFile(getName(), "home");
homeDir.delete();
homeDir.mkdirs();
} catch (IOException e) {
throw new IllegalStateException("Can't create temporary application home", e);
}
logger.warn("Could not determine application's user home,"
+ " using temporary dir " + homeDir);
} else {
homeDir = new ApplicationUserHome(getName(), System.getProperty(APP_HOME)).getAppUserHome();
}
if (homeDir == null || !homeDir.isDirectory()) {
throw new IllegalStateException("Could not create application home directory "
+ homeDir);
}
}
return homeDir.toPath();
}