Issue Details (XML | Word | Printable)

Key: CASTOR-2613
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Werner Guttmann
Reporter: John Huss
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
castor

Enable loading of properties from a file specified at startup

Created: 15/Jan/09 02:57 PM   Updated: 26/Jan/09 08:59 AM   Resolved: 21/Jan/09 01:36 PM
Return to search
Component/s: Core
Affects Version/s: 1.3 rc1
Fix Version/s: 1.3

Time Tracking:
Original Estimate: Not Specified
Remaining Estimate: 0 minutes
Remaining Estimate - 0 minutes
Time Spent: 50 minutes
Time Spent - 50 minutes

File Attachments: 1. Text File patch.c2613.20090115.txt (1 kB)



 Description  « Hide

Enable loading of properties from a file specified at startup, rather than only from a file on the classpath.

In org.castor.core.util.Configuration, lines 161

protected void loadUserProperties(final String filename) {
       Properties properties = new Properties();

       .....

       String property = System.getProperty("org.castor.properties.custom");
       if (property != null && property.length() > 0) {
           File file = new File(property);
           if (file.exists()) {
               loadFromFile(properties, file);
           }
       }

       _map.putAll(properties);
   }


Werner Guttmann made changes - 15/Jan/09 04:17 PM
Field Original Value New Value
Assignee Werner Guttmann [ wguttmn ]
Werner Guttmann made changes - 15/Jan/09 04:17 PM
Status Open [ 1 ] In Progress [ 3 ]
Werner Guttmann logged work - 15/Jan/09 04:18 PM
Time Worked: 10 minutes
Patch creation and initial testing.
Werner Guttmann added a comment - 15/Jan/09 04:18 PM

Initial patch for review (and testing).


Werner Guttmann made changes - 15/Jan/09 04:18 PM
Attachment patch.c2613.20090115.txt [ 39356 ]
Werner Guttmann made changes - 15/Jan/09 04:18 PM
Status In Progress [ 3 ] Open [ 1 ]
Werner Guttmann made changes - 15/Jan/09 04:18 PM
Time Spent 10 minutes [ 600 ]
Remaining Estimate 0 minutes [ 0 ]
Werner Guttmann made changes - 15/Jan/09 04:20 PM
Fix Version/s 1.3 [ 14004 ]
Werner Guttmann made changes - 15/Jan/09 04:20 PM
Description Enable loading of properties from a file specified at startup, rather than only from a file on the classpath.

In org.castor.core.util.Configuration, lines 161

   protected void loadUserProperties(final String filename) {
       Properties properties = new Properties();

       .....

       String property = System.getProperty("org.castor.properties.custom");
       if (property != null && property.length() > 0) {
           File file = new File(property);
           if (file.exists()) {
               loadFromFile(properties, file);
           }
       }

       _map.putAll(properties);
   }
Enable loading of properties from a file specified at startup, rather than only from a file on the classpath.

In org.castor.core.util.Configuration, lines 161

{code}

   protected void loadUserProperties(final String filename) {
       Properties properties = new Properties();

       .....

       String property = System.getProperty("org.castor.properties.custom");
       if (property != null && property.length() > 0) {
           File file = new File(property);
           if (file.exists()) {
               loadFromFile(properties, file);
           }
       }

       _map.putAll(properties);
   }

{code}
Werner Guttmann made changes - 21/Jan/09 07:03 AM
Fix Version/s 1.3.1 [ 14004 ]
Fix Version/s 1.3 [ 14917 ]
Werner Guttmann added a comment - 21/Jan/09 07:17 AM

Any feedback ?


Werner Guttmann logged work - 21/Jan/09 01:23 PM
Time Worked: 40 minutes
Patch creation, testing and integration.
Werner Guttmann made changes - 21/Jan/09 01:24 PM
Time Spent 10 minutes [ 600 ] 50 minutes [ 3000 ]
Werner Guttmann made changes - 21/Jan/09 01:36 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
John Huss added a comment - 23/Jan/09 11:57 AM

I just tested this and it works great. Thanks a lot.


Ralf Joachim made changes - 24/Jan/09 11:12 AM
Status Resolved [ 5 ] Closed [ 6 ]
Werner Guttmann added a comment - 26/Jan/09 04:03 AM

Thanks, John. Was this after I actually applied the patch ?


John Huss added a comment - 26/Jan/09 08:59 AM

Yes, I checked out the code from the repository and build a snapshot build.