Started work on componentizing the current user management.
[utils] / system / spring / src / main / java / org / wamblee / system / spring / PropertySetter.java
index 00b9f307b0c1db46d5508736a6b30cf52233cac7..a53dab516e6be01a8b89ae808bbd30f5db5dd4c7 100644 (file)
@@ -34,13 +34,18 @@ class PropertySetter extends PropertyPlaceholderConfigurer {
         * @param aProps Properties. 
         */
        public PropertySetter(Properties aProps) { 
-                StringBuffer buf = new StringBuffer();  
+                String propFile = createPropertyFile(aProps); 
+                setLocation(new StringResource(propFile));
+       }
+
+    private static String createPropertyFile(Properties aProps) {
+        StringBuffer buf = new StringBuffer();  
                 for (Object key: aProps.keySet()) {  
                         buf.append(key);
                         buf.append("=");
                         buf.append(aProps.get(key));
                         buf.append("\n");
-                } 
-                setLocation(new StringResource(buf.toString()));
-       }
+                }
+        return buf.toString();
+    }
 }