Index: /trunk/de.ugoe.cs.swe.exercises/.classpath
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/.classpath	(revision 30)
+++ /trunk/de.ugoe.cs.swe.exercises/.classpath	(revision 31)
@@ -1,4 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+	<classpathentry exported="true" kind="lib" path="lib/xpp3_min-1.1.4c.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/xstream-1.3.1.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/org.eclipse.nebula.widgets.formattedtext_1.0.0.HEAD.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/org.eclipse.nebula.widgets.datechooser_1.0.0.HEAD.jar"/>
Index: /trunk/de.ugoe.cs.swe.exercises/META-INF/MANIFEST.MF
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/META-INF/MANIFEST.MF	(revision 30)
+++ /trunk/de.ugoe.cs.swe.exercises/META-INF/MANIFEST.MF	(revision 31)
@@ -22,5 +22,7 @@
  lib/trilead.jar,
  lib/org.eclipse.nebula.widgets.datechooser_1.0.0.HEAD.jar,
- lib/org.eclipse.nebula.widgets.formattedtext_1.0.0.HEAD.jar
+ lib/org.eclipse.nebula.widgets.formattedtext_1.0.0.HEAD.jar,
+ lib/xpp3_min-1.1.4c.jar,
+ lib/xstream-1.3.1.jar
 Bundle-Vendor: Software Engineering for Distributed Systems Group, Uni Goettingen
 Export-Package: de.ugoe.cs.swe.exercises,
Index: /trunk/de.ugoe.cs.swe.exercises/build.properties
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/build.properties	(revision 30)
+++ /trunk/de.ugoe.cs.swe.exercises/build.properties	(revision 31)
@@ -15,4 +15,6 @@
                lib/org.eclipse.nebula.widgets.formattedtext_1.0.0.HEAD.jar,\
                epl-v10.html,\
-               epl-v10.txt
+               epl-v10.txt,\
+               lib/xpp3_min-1.1.4c.jar,\
+               lib/xstream-1.3.1.jar
 source.. = src/
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/Application.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/Application.java	(revision 30)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/Application.java	(revision 31)
@@ -37,13 +37,10 @@
 	public Object start(IApplicationContext context) {
 		Display display = PlatformUI.createDisplay();
+		Settings.getInstance().load();
 		SettingsDialog settingsDialog = new SettingsDialog(new Shell());
-		/* try{ */
-		if (!Settings.getInstance().isInitialized())
+		if (!Settings.getInstance().isInitialized()) {
 			settingsDialog.open();
-		/*
-		 * } catch (NullPointerException ex){ settingsDialog.open(); } catch
-		 * (IllegalArgumentException ex) { settingsDialog.open(); } catch
-		 * (Exception ex) { settingsDialog.open(); }
-		 */
+		}
+
 		try {
 			DAVRepositoryFactory.setup();
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/misc/FileUtils.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/misc/FileUtils.java	(revision 30)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/misc/FileUtils.java	(revision 31)
@@ -1,8 +1,12 @@
 package de.ugoe.cs.swe.exercises.misc;
 
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.FileWriter;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.nio.channels.FileChannel;
 
@@ -27,8 +31,10 @@
 
 	public static void renameFile(String oldName, String newName) {
-		
-		File oldFile = new File(ExerciseSVN.SVNpath + "exercisesheets/" + oldName);
-		File newFile = new File(ExerciseSVN.SVNpath + "exercisesheets/" + newName);
-		
+
+		File oldFile = new File(ExerciseSVN.SVNpath + "exercisesheets/"
+				+ oldName);
+		File newFile = new File(ExerciseSVN.SVNpath + "exercisesheets/"
+				+ newName);
+
 		try {
 			copyFile(oldFile, newFile);
@@ -40,3 +46,25 @@
 	}
 
+	public static String readFileAsString(String filePath) throws IOException {
+		BufferedReader br = new BufferedReader(new InputStreamReader(
+				new FileInputStream(filePath)));
+		StringBuffer contentOfFile = new StringBuffer();
+		String line;
+		while ((line = br.readLine()) != null) {
+			contentOfFile.append(line);
+		}
+		return contentOfFile.toString();
+	}
+
+	public static void writeStringAsFile(String filePath, String content)
+			throws IOException {
+		try {
+			BufferedWriter out = new BufferedWriter(new FileWriter(filePath));
+			out.write(content);
+			out.close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
 }
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/Settings.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/Settings.java	(revision 30)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/Settings.java	(revision 31)
@@ -1,3 +1,8 @@
 package de.ugoe.cs.swe.exercises.settings;
+
+import java.io.File;
+import java.io.IOException;
+import com.thoughtworks.xstream.XStream;
+import de.ugoe.cs.swe.exercises.misc.FileUtils;
 
 public class Settings {
@@ -37,6 +42,14 @@
 	}
 
+	private String nullCheck(String str) {
+		if (str == null)
+			return "";
+		else
+			return str;
+			
+	}
+	
 	public String getSvnLocation() {
-		return svnLocation;
+		return nullCheck(svnLocation);
 	}
 
@@ -46,5 +59,5 @@
 
 	public String getWorkingDirectory() {
-		return workingDirectory;
+		return nullCheck(workingDirectory);
 	}
 
@@ -54,5 +67,5 @@
 
 	public String getSvnUsername() {
-		return svnUsername;
+		return nullCheck(svnUsername);
 	}
 
@@ -62,5 +75,5 @@
 
 	public String getSvnPassword() {
-		return svnPassword;
+		return nullCheck(svnPassword);
 	}
 
@@ -70,5 +83,5 @@
 
 	public String getMysqlHost() {
-		return mysqlHost;
+		return nullCheck(mysqlHost);
 	}
 
@@ -78,5 +91,5 @@
 
 	public String getMysqlDb() {
-		return mysqlDb;
+		return nullCheck(mysqlDb);
 	}
 
@@ -86,5 +99,5 @@
 
 	public String getMysqlUsername() {
-		return mysqlUsername;
+		return nullCheck(mysqlUsername);
 	}
 
@@ -94,5 +107,5 @@
 
 	public String getMysqlPassword() {
-		return mysqlPassword;
+		return nullCheck(mysqlPassword);
 	}
 
@@ -102,5 +115,5 @@
 
 	public String getPdfLatexPath() {
-		return pdfLatexPath;
+		return nullCheck(pdfLatexPath);
 	}
 
@@ -110,5 +123,5 @@
 
 	public String getResearchGroup() {
-		return researchGroup;
+		return nullCheck(researchGroup);
 	}
 
@@ -118,5 +131,5 @@
 
 	public String getResearchGroupUrl() {
-		return researchGroupUrl;
+		return nullCheck(researchGroupUrl);
 	}
 
@@ -133,3 +146,65 @@
 	}
 
+	public void load() {
+		File file = new File(System.getProperty("user.home")
+				+ "/exercises_settings.xml");
+		if (file.exists()) {
+			try {
+				String content = FileUtils.readFileAsString(file.getAbsolutePath());
+				XStream xstream = new XStream();
+				xstream.alias("ExercisesSettings", Settings.class);
+				settings = (Settings) xstream.fromXML(content);
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	public void save() {
+		File file = new File(System.getProperty("user.home")
+				+ "/exercises_settings.xml");
+
+		XStream xstream = new XStream();
+		xstream.alias("ExercisesSettings", Settings.class);
+		String xml = xstream.toXML(settings);
+		try {
+			FileUtils.writeStringAsFile(file.getAbsolutePath(), xml);
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("Settings [mysqlDb=");
+		builder.append(mysqlDb);
+		builder.append(", mysqlHost=");
+		builder.append(mysqlHost);
+		builder.append(", mysqlPassword=");
+		builder.append(mysqlPassword);
+		builder.append(", mysqlSSL=");
+		builder.append(mysqlSSL);
+		builder.append(", mysqlUsername=");
+		builder.append(mysqlUsername);
+		builder.append(", pdfLatexPath=");
+		builder.append(pdfLatexPath);
+		builder.append(", researchGroup=");
+		builder.append(researchGroup);
+		builder.append(", researchGroupUrl=");
+		builder.append(researchGroupUrl);
+		builder.append(", svnLocation=");
+		builder.append(svnLocation);
+		builder.append(", svnPassword=");
+		builder.append(svnPassword);
+		builder.append(", svnUsername=");
+		builder.append(svnUsername);
+		builder.append(", workingDirectory=");
+		builder.append(workingDirectory);
+		builder.append("]");
+		return builder.toString();
+	}
+
+	
+	
 }
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsDialog.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsDialog.java	(revision 30)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsDialog.java	(revision 31)
@@ -1,12 +1,6 @@
 package de.ugoe.cs.swe.exercises.settings;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
 import java.sql.DriverManager;
 import java.sql.SQLException;
-import java.util.Properties;
 
 import org.eclipse.jface.dialogs.IMessageProvider;
@@ -52,6 +46,5 @@
 	public SettingsDialog(Shell parentShell) {
 		super(parentShell);
-		this.getFileContents();
-		setTitle("Settings");
+		Settings.getInstance().load();
 	}
 
@@ -259,5 +252,5 @@
 						return;
 					}
-					setFileContents();
+					Settings.getInstance().save();
 					close();
 
@@ -278,72 +271,3 @@
 	}
 
-	private void getFileContents() {
-		Properties properties = new Properties();
-		File file = new File(System.getProperty("user.home")
-				+ "/.exerciseSettings");
-		if (file.exists()) {
-			try {
-				properties.load(new FileInputStream(file));
-			} catch (FileNotFoundException e) {
-				e.printStackTrace();
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-			try {
-				Settings settings = Settings.getInstance();
-				settings.setSvnLocation(properties.getProperty("svnLocation"));
-				settings.setWorkingDirectory(properties.getProperty("workingDirectory"));
-				settings.setSvnUsername(properties.getProperty("svnUsername"));
-				settings.setSvnPassword(properties.getProperty("svnPassword"));
-				settings.setMysqlHost(properties.getProperty("mySQLHost"));
-				settings.setMysqlDb(properties.getProperty("mySQLDb"));
-				settings.setMysqlUsername(properties.getProperty("mySQLUsername"));
-				settings.setMysqlPassword(properties.getProperty("mySQLPassword"));
-				settings.setMysqlSSL(Boolean.parseBoolean(properties
-						.getProperty("mySQLcheckSSL")));
-				settings.setPdfLatexPath(properties.getProperty("pdfLatexPath"));
-				settings.setResearchGroup(properties.getProperty("researchGroup"));
-				settings.setResearchGroupUrl(properties.getProperty("researchGroupUrl"));
-			} catch (Exception ex) {
-			}
-		}
-	}
-
-	private void setFileContents() {
-		Properties properties = new Properties();
-		File file = new File(System.getProperty("user.home")
-				+ "/.exerciseSettings");
-		if (!file.exists()) {
-			try {
-				file.createNewFile();
-			} catch (IOException e) {
-				e.printStackTrace();
-				return;
-			}
-		}
-		Settings settings = Settings.getInstance();
-
-		properties.setProperty("svnLocation", settings.getSvnLocation());
-		properties.setProperty("workingDirectory", settings.getWorkingDirectory());
-		properties.setProperty("svnUsername", settings.getSvnUsername());
-		properties.setProperty("svnPassword", settings.getSvnPassword());
-		properties.setProperty("mySQLHost", settings.getMysqlHost());
-		properties.setProperty("mySQLDb", settings.getMysqlDb());
-		properties.setProperty("mySQLUsername", settings.getMysqlUsername());
-		properties.setProperty("mySQLPassword", settings.getMysqlPassword());
-		properties.setProperty("mySQLcheckSSL", String.valueOf(settings.isMysqlSSL()));
-		properties.setProperty("pdfLatexPath", settings.getPdfLatexPath());
-		properties.setProperty("researchGroup", settings.getResearchGroup());
-		properties.setProperty("researchGroupUrl", settings.getResearchGroupUrl());
-
-		try {
-			properties.store(new FileOutputStream(file),
-					"SVN and other Settings included");
-		} catch (FileNotFoundException e) {
-			e.printStackTrace();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
 }
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsDialog2.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsDialog2.java	(revision 30)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsDialog2.java	(revision 31)
@@ -16,4 +16,5 @@
 	public SettingsDialog2(Shell parentShell) {
 		super(parentShell);
+		Settings.getInstance().load();
 	}
 
