return (Settings)xstream.fromXML(new FileInputStream(filename));
} catch (Exception e) {
org.apache.log4j.Logger fLog = org.apache.log4j.Logger.getLogger("log.settings");
fLog.error("Unable to load settings, resetting to default.", e);
NSAlertBox alert = new NSAlertBox("Unable to load settings","The file settings.xml was corrupted or was not formatted correctly. Settings have reverted to their defaults.",SWT.OK,SWT.ICON_WARNING);
alert.go();
Settings defaultSettings = new Settings();
settings = defaultSettings;
writeToFile();
return defaultSettings;
}