Author: echatellier Date: 2009-10-19 14:44:59 +0200 (Mon, 19 Oct 2009) New Revision: 1688 Modified: trunk/changelog.txt trunk/src/main/java/org/nuiton/util/ApplicationConfig.java Log: Force application configuration properties to be written sorted Modified: trunk/changelog.txt =================================================================== --- trunk/changelog.txt 2009-10-11 11:27:27 UTC (rev 1687) +++ trunk/changelog.txt 2009-10-19 12:44:59 UTC (rev 1688) @@ -1,5 +1,6 @@ 1.1.2 xxx 200910xx + * [FEATURE] Force application configuration properties to be written sorted * [FEATURE] Add sed and grep method on FileUtil -- Modified: trunk/src/main/java/org/nuiton/util/ApplicationConfig.java =================================================================== --- trunk/src/main/java/org/nuiton/util/ApplicationConfig.java 2009-10-11 11:27:27 UTC (rev 1687) +++ trunk/src/main/java/org/nuiton/util/ApplicationConfig.java 2009-10-19 12:44:59 UTC (rev 1688) @@ -416,7 +416,10 @@ * @throws IOException if IO pb */ public void save(File file, boolean forceAll, String... excludeKeys) throws IOException { - Properties prop = new Properties(); + + // store sorted in file + Properties prop = new SortedProperties(); + if (forceAll) { prop.putAll(defaults); prop.putAll(classpath);
Le Mon, 19 Oct 2009 14:45:00 +0200 (CEST), echatellier@users.nuiton.org a écrit :
Author: echatellier Date: 2009-10-19 14:44:59 +0200 (Mon, 19 Oct 2009) New Revision: 1688
Modified: trunk/changelog.txt trunk/src/main/java/org/nuiton/util/ApplicationConfig.java Log: Force application configuration properties to be written sorted
Modified: trunk/changelog.txt =================================================================== --- trunk/changelog.txt 2009-10-11 11:27:27 UTC (rev 1687) +++ trunk/changelog.txt 2009-10-19 12:44:59 UTC (rev 1688) @@ -1,5 +1,6 @@ 1.1.2 xxx 200910xx
+ * [FEATURE] Force application configuration properties to be written sorted ca serait bien de lier un peu ça avec le redmine ? un numéro de tache serait bien je trouve ;)
* [FEATURE] Add sed and grep method on FileUtil
--
Modified: trunk/src/main/java/org/nuiton/util/ApplicationConfig.java =================================================================== --- trunk/src/main/java/org/nuiton/util/ApplicationConfig.java 2009-10-11 11:27:27 UTC (rev 1687) +++ trunk/src/main/java/org/nuiton/util/ApplicationConfig.java 2009-10-19 12:44:59 UTC (rev 1688) @@ -416,7 +416,10 @@ * @throws IOException if IO pb */ public void save(File file, boolean forceAll, String... excludeKeys) throws IOException { - Properties prop = new Properties(); + + // store sorted in file + Properties prop = new SortedProperties(); + if (forceAll) { prop.putAll(defaults); prop.putAll(classpath);
_______________________________________________ Nuiton-utils-commits mailing list Nuiton-utils-commits@list.nuiton.org http://list.nuiton.org/cgi-bin/mailman/listinfo/nuiton-utils-commits
-- Tony Chemit -------------------- tél: +33 (0) 2 40 50 29 28 email: chemit@codelutin.com http://www.codelutin.com
participants (2)
-
echatellier@users.nuiton.org -
Tony Chemit