package com.github.aureliano.edocs.common.config;

import com.github.aureliano.edocs.common.helper.ConfigurationHelper;

public final class ConfigurationSingleton {

	private static ConfigurationSingleton instance;
	
	private AppConfiguration configuration;
	
	private ConfigurationSingleton() {}
	
	public static final ConfigurationSingleton instance() {
		if (instance == null) {
			instance = new ConfigurationSingleton();
		}
		
		return instance;
	}
	
	public void setAppConfiguration(AppConfiguration configuration) {
		this.configuration = configuration;
	}
	
	public AppConfiguration getAppConfiguration() {
		if (this.configuration == null) {
			this.loadDefaultAppConfiguration();
		}
		
		return this.configuration;
	}
	
	public void loadDefaultAppConfiguration() {
		this.configuration = ConfigurationHelper.parseConfiguration();
	}
}
@@ -601,24 +601,43 @@
 nfiguration(
+boolean loadDefault
 ) %7B%0A%09%09if (th
@@ -633,16 +633,17 @@
  %7B%0A%09%09if 
+(
 (this.co
@@ -663,21 +663,60 @@
 = null) 
-%7B%0A%09%09%09
+&& (loadDefault)) %7B%0A%09%09%09this.configuration = 
 this.loa
@@ -796,23 +796,27 @@
 lic 
-void loadDefaul
+AppConfiguration ge
 tApp
@@ -835,36 +835,126 @@
 n() %7B%0A%09%09
-this.configuration =
+return this.getAppConfiguration(false);%0A%09%7D%0A%09%0A%09public AppConfiguration loadDefaultAppConfiguration() %7B%0A%09%09return
  Configu

Create configuration singleton.