public static String getConfigDir() {
                String dir = null;
                String os = System.getProperty("os.name").toUpperCase();
                if (os.startsWith("WINDOWS")) {
                        dir = System.getenv("APPDATA") + File.separator + "DarkIRC";
                } else if (os.startsWith("LINUX")) {
                        dir = System.getProperty("user.home") + File.separator + ".DarkIRC";
                } else if (os.startsWith("mac")) {
                        dir = System.getProperty("user.home") + File.separator + "Library" + File.separator + "Application Support" + ".DarkIRC";
                } else {
                        System.out.println("Error System inconnue");
                        System.exit(1);
                }
                if (!(new File(dir).exists())) {
                        new File(dir).mkdirs();
                }
                return dir;
        }