private InteractionPreference()

in taverna-interaction-activity/src/main/java/org/apache/taverna/activities/interaction/preference/InteractionPreference.java [88:132]


	private InteractionPreference(ApplicationConfiguration appConfig) {
		setAppConfig(appConfig);
		final File configFile = this.getConfigFile();
		this.properties = new Properties();
		if (configFile.exists()) {
			try {
				final FileReader reader = new FileReader(configFile);
				this.properties.load(reader);
				reader.close();
			} catch (final FileNotFoundException e) {
				this.logger.error(e);
			} catch (final IOException e) {
				this.logger.error(e);
			}
		}
		if (GraphicsEnvironment.isHeadless()
				|| ((System.getProperty("java.awt.headless") != null) && System
						.getProperty("java.awt.headless").equals("true"))) {
			final String definedHost = System
					.getProperty("taverna.interaction.host");
			if (definedHost != null) {
				this.properties.setProperty(USE_JETTY, "false");
				this.logger.info("USE_JETTY set to false");
				this.properties.setProperty(HOST, definedHost);
			}
			final String definedPort = System
					.getProperty("taverna.interaction.port");
			if (definedPort != null) {
				this.properties.setProperty(PORT, definedPort);
			}
			final String definedWebDavPath = System
					.getProperty("taverna.interaction.webdav_path");
			if (definedWebDavPath != null) {
				this.properties.setProperty(WEBDAV_PATH, definedWebDavPath);
			}
			final String definedFeedPath = System
					.getProperty("taverna.interaction.feed_path");
			if (definedFeedPath != null) {
				this.properties.setProperty(FEED_PATH, definedFeedPath);
			}
		} else {
			this.logger.info("Running non-headless");
		}
		this.fillDefaultProperties();
	}