Author: fdesbois Date: 2009-12-17 17:50:05 +0100 (Thu, 17 Dec 2009) New Revision: 1720 Modified: trunk/src/main/java/org/nuiton/util/ApplicationConfig.java Log: Revert from previous change : keep old config emplacment for user : $HOME/.[filename]. Will be done for a future version. Modified: trunk/src/main/java/org/nuiton/util/ApplicationConfig.java =================================================================== --- trunk/src/main/java/org/nuiton/util/ApplicationConfig.java 2009-12-17 16:36:57 UTC (rev 1719) +++ trunk/src/main/java/org/nuiton/util/ApplicationConfig.java 2009-12-17 16:50:05 UTC (rev 1720) @@ -274,12 +274,10 @@ /** file /etc/[filename] */ String systemPath = File.separator + "etc" + File.separator; /** file $user.home/.[filename] */ - @Deprecated - String userPath1 = getUserHome() + File.separator + "."; + //@Deprecated + String userPath = getUserHome() + File.separator + "."; /** file $user.home/.local/[filename] */ - String userPath2 = getUserHome() + File.separator + ".config" + File.separator; - //String userPath = getUserHome() + File.separator + ".local" + - // /*File.separator + "share" + File.separator + "applications" + */File.separator; + //String userPath2 = getUserHome() + File.separator + ".config" + File.separator; /** vrai si on est en train de parser les options de la ligne de commande */ protected boolean inParseOptionPhase = false; protected Properties defaults = new Properties(); @@ -470,7 +468,7 @@ * @param excludeKeys optional list of keys to exclude from */ public void saveForUser(String... excludeKeys) { - File file = new File(userPath2 + getConfigFileName()); + File file = new File(userPath + getConfigFileName()); try { save(file, false, excludeKeys); } catch (IOException eee) { @@ -967,16 +965,20 @@ etcfile.load(etcConfig.toURI().toURL().openStream()); } - File homeConfig1 = new File(userPath1 + filename); - File homeConfig2 = new File(userPath2 + filename); - if (!homeConfig2.exists() && homeConfig1.exists()) { - log.info("Déplacement de l'ancien fichier de config: " + homeConfig1); - homeConfig1.renameTo(homeConfig2); + File homeConfig = new File(userPath + filename); + if (homeConfig.exists()) { + log.info("Chargement du fichier de config: " + homeConfig); + homefile.load(homeConfig.toURI().toURL().openStream()); } - if (homeConfig2.exists()) { - log.info("Chargement du fichier de config: " + homeConfig2); - homefile.load(homeConfig2.toURI().toURL().openStream()); - } +// File homeConfig2 = new File(userPath2 + filename); +// if (!homeConfig2.exists() && homeConfig1.exists()) { +// log.info("Déplacement de l'ancien fichier de config: " + homeConfig1); +// homeConfig1.renameTo(homeConfig2); +// } +// if (homeConfig2.exists()) { +// log.info("Chargement du fichier de config: " + homeConfig2); +// homefile.load(homeConfig2.toURI().toURL().openStream()); +// } // file $CURDIR/filename File config = new File(filename);
participants (1)
-
fdesbois@users.nuiton.org