ctubbsii commented on a change in pull request #1077: Updated commons config 
from ver 1 to 2
URL: https://github.com/apache/fluo/pull/1077#discussion_r313147286
 
 

 ##########
 File path: 
modules/api/src/main/java/org/apache/fluo/api/config/SimpleConfiguration.java
 ##########
 @@ -192,34 +195,30 @@ public void load(InputStream in) {
    * @since 1.2.0
    */
   public void load(File file) {
-    try {
-      PropertiesConfiguration config = new PropertiesConfiguration();
-      // disabled to prevent accumulo classpath value from being shortened
-      config.setDelimiterParsingDisabled(true);
-      config.load(file);
+    try(InputStream in = Files.newInputStream(file.toPath())) {
+      PropertiesConfiguration config = newPropertiesConfiguration();
+      new FileHandler(config).load(cleanUp(in));
       ((CompositeConfiguration) internalConfig).addConfiguration(config);
-    } catch (ConfigurationException e) {
+    } catch (ConfigurationException | IOException e) {
       throw new IllegalArgumentException(e);
     }
   }
 
   public void save(File file) {
-    PropertiesConfiguration pconf = new PropertiesConfiguration();
-    pconf.setDelimiterParsingDisabled(true);
-    pconf.append(internalConfig);
     try {
-      pconf.save(file);
+      PropertiesConfiguration pconf = newPropertiesConfiguration();
+      pconf.append(internalConfig);
+      new FileHandler(pconf).save(file);
 
 Review comment:
   Instead of FileHandler, you should use the PropertyConfigurationLayout to 
save it to a FileWriter.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to