/**
 * 
 */
package org.josast.property;

import java.io.File;
import java.util.logging.Logger;

/**
 * @author Christophe
 *
 */
public abstract class ConfigObject {
	
	private Logger log = Logger.getLogger(getClass().getName());
	private String ConfigFilename=null;
	private String fullConfigFilename=null;
	
	protected CONFIG ConfigFile = CONFIG.getInstance();

	public ConfigObject ()
	{
		
	}
	
	public String getFulFileName()
	{
		fullConfigFilename = System.getProperty("user.dir")+"/config";
    	File apath = new File(fullConfigFilename);
    		
    		if (!apath.exists())
    		{
    			boolean res =  apath.mkdir();
    			if (!res)
    			{
    				log.severe("fail to create "+ fullConfigFilename);
    				
    			}
    		}
			return fullConfigFilename;
	}
	
	
	
	/**
	 * @param configFilename  Configuration file name
	 */
	public ConfigObject(String configFilename) {
		super();
		ConfigFilename = configFilename;
		ConfigFile.setFileName(configFilename);
	}



	/**
	 * @return  Configuration Filename
	 */
	public String getConfigFilename() {
		return ConfigFilename;
	}
	
	
	

}
