package space.signux;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class Synchronizer {

	private ConnectionSettings inputConnection;
	private ConnectionSettings outputConnection;

	public static void main(String[] args) {
		Synchronizer synchronizer = new Synchronizer();
		synchronizer.loadSettings();
	}

	private void loadSettings() {
		String filename = "settings.txt";
		File propertiesFile = new File(filename);
		FileInputStream in;
		try {
			in = new FileInputStream(propertiesFile);
			Properties properties = new Properties();
			properties.load(in);
			inputConnection = SettingsReader.CreateInputConnectionSettings(properties);
			outputConnection = SettingsReader.CreateOutputConnectionSettings(properties);
		} catch (FileNotFoundException e) {
			System.out.println("Can't find file " + filename);
		} catch (IOException e) {
			System.out.println("Can't load file " + filename);
		}

	}
}

@@ -380,16 +380,21 @@
 er();%0A%09%09
+if (!
 synchron
@@ -411,18 +411,40 @@
 ettings(
-);
+args)) %7B%0A%09%09%09return;%0A%09%09%7D%0A
 %0A%09%7D%0A%0A%09pr
@@ -449,20 +449,23 @@
 private 
-void
+boolean
  loadSet
@@ -470,20 +470,34 @@
 ettings(
+String%5B%5D args
 ) %7B%0A
+%0A
 %09%09String
@@ -530,79 +530,320 @@
 ;%0A%09%09
-File propertiesFile = new File(filename);%0A%09%09FileInputStream in;%0A%09%09try %7B
+if (args.length %3E 0) %7B%0A%09%09%09filename = args%5B0%5D;%0A%09%09%7D%0A%09%09File settingsFile = new File(filename);%0A%0A%09%09if (!settingsFile.exists()) %7B%0A%09%09%09System.out.println(%22settings file: %22 + filename + %22 doesn't exist!%22);%0A%09%09%09return false;%0A%09%09%7D%0A%0A%09%09FileInputStream in;%0A%09%09try %7B%0A%09%09%09System.out.println(%22load settings from file: %22 + filename);
 %0A%09%09%09
@@ -867,25 +867,23 @@
 tStream(
-propertie
+setting
 sFile);%0A
@@ -1183,24 +1183,25 @@
 't find file
+:
  %22 + filenam
@@ -1204,16 +1204,33 @@
 ename);%0A
+%09%09%09return false;%0A
 %09%09%7D catc
@@ -1287,16 +1287,17 @@
 oad file
+:
  %22 + fil
@@ -1302,20 +1302,51 @@
 ilename);%0A%09%09
-%7D%0A
+%09return false;%0A%09%09%7D%0A%09%09return true;
 %0A%09%7D%0A%7D%0A

read settings from commandline parameter added