fluo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [fluo] keith-turner commented on a change in pull request #1077: Updated commons config from ver 1 to 2
Date Tue, 13 Aug 2019 13:47:03 GMT
keith-turner 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_r313405167
 
 

 ##########
 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);
     } catch (ConfigurationException e) {
       throw new FluoException(e);
     }
   }
 
   public void save(OutputStream out) {
-    PropertiesConfiguration pconf = new PropertiesConfiguration();
-    pconf.setDelimiterParsingDisabled(true);
-    pconf.append(internalConfig);
     try {
-      pconf.save(out);
+      PropertiesConfiguration pconf = newPropertiesConfiguration();
+      pconf.append(internalConfig);
+      new FileHandler(pconf).save(out);
 
 Review comment:
   Ok, I just took the first thing I found that worked.  Not sure what the diff is between
what I did and what you proposed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message