/**
 * 
 */
package fr.esiea.CanadianLumberjack;

import java.io.File;
import java.util.HashMap;
import java.util.LinkedList;

/**
 * Configure a <code>LoggerFactory</code>
 *
 *@see LoggerFactory
 */
public class Configuration {

	
	@SuppressWarnings("rawtypes")
	private HashMap<Class, LinkedList<Target>> targets;
	
	/**
	 * Constructor with default parameters.
	 * <br>Default parameters are:
	 * <br>For each class :
	 * <br>errorlevel: <code>ERROR</code>
	 * <br>target: <code>TargetConsole</code>
	 *  
	 *  @see TargetConsole
	 */
	public Configuration(){
		
	}
	
	/**
	 * Uses the configuration specified in the properties file in parameter
	 * 
	 * DOCUMENTATION DU FICHIER PROPERTIES :
	 *  faire
	 * 
	 * @param configFile
	 */
	public Configuration(File configFile)/* throws FileException, BadConfigException */{
		/* A DEFINIR */
		
		/* le fileexception est  redfinir (il faut jeter une exception s'il y a un souci avec le fichier)
		 * et le badconfigexceptin est  crer */
		
	}
	
	/**
	 * Add a target to a class
	 * Using it for the first time overwrite the default value
	 * 
	 * 
	 * @param sClass The specified class
	 * @param target The target to add to the specified class
	 */
	@SuppressWarnings("rawtypes")
	public void ajouterCible(Class sClass, Target target){
		
		if(targets.containsKey(sClass)){
			targets.get(sClass).add(target);
		}
		else{
			LinkedList<Target> l = new LinkedList<Target>();
			l.add(target);
			targets.put(sClass, l);
		}
			/* A DEFINIR */
	}
}

@@ -70,16 +70,146 @@
 .File;%0D%0A
+import java.io.FileInputStream;%0D%0Aimport java.io.FileNotFoundException;%0D%0Aimport java.io.IOException;%0D%0Aimport java.io.InputStream;%0D%0A
 import j
@@ -256,16 +256,46 @@
 edList;%0D
+%0Aimport java.util.Properties;%0D
 %0A%0D%0A/**%0D%0A
@@ -895,14 +895,12 @@
 %09 * 
- faire
+TODO
 %0D%0A%09 
@@ -970,18 +970,16 @@
 figFile)
-/*
  throws 
@@ -982,16 +982,24 @@
 ows File
+NotFound
 Exceptio
@@ -999,16 +999,19 @@
 xception
+ /*
 , BadCon
@@ -1051,16 +1051,252 @@
 */%0D%0A%09%09%0D%0A
+%09%09Properties props = new Properties();%0D%0A%09%09InputStream is = null;%0D%0A%09%09%0D%0A%09%09is = new FileInputStream(configFile);%0D%0A%09%09%0D%0A%09%09// TODO  %0D%0A%09%09%0D%0A%09%09%0D%0A%09%09try %7B%0D%0A%09%09%09is.close();%0D%0A%09%09%7D catch (IOException e) %7B%0D%0A%09%09%09e.printStackTrace();%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A
 %09%09/* le 

structure du fichier properties