Dictionnaries.java

package org.docascode.office;

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

public class Dictionnaries {
    private HashMap<File, HashMap<String,String>> dictionnaries = new HashMap<File, HashMap<String,String>>();

    private static Dictionnaries ourInstance = new Dictionnaries();

    public static Dictionnaries getInstance() {
        return ourInstance;
    }

    private Dictionnaries() {
    }

    public HashMap<String,String> get(File file){
        if (!this.dictionnaries.containsKey(file)){
            PropertyCtrl propertyCtrl = new PropertyCtrl();
            HashMap<String,String> dict = propertyCtrl.getProperties(file);
            this.dictionnaries.put(file,dict);
        }
        return this.dictionnaries.get(file);
    }
}