svn commit: r766193 - /ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r766193 - /ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java

doogie-3
Author: doogie
Date: Sat Apr 18 01:07:54 2009
New Revision: 766193

URL: http://svn.apache.org/viewvc?rev=766193&view=rev
Log:
Add a feature for setting any system property by reading from a file.

Modified:
    ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java

Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java?rev=766193&r1=766192&r2=766193&view=diff
==============================================================================
--- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java (original)
+++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Start.java Sat Apr 18 01:07:54 2009
@@ -373,6 +373,14 @@
         String firstArg = args.length > 0 ? args[0] : "";
         Start start = new Start();
 
+        String globalSystemPropsFileName = System.getProperty("ofbiz.system.props");
+        if (globalSystemPropsFileName != null) {
+            try {
+                System.getProperties().load(new FileInputStream(globalSystemPropsFileName));
+            } catch (IOException e) {
+                throw (IOException) new IOException("Couldn't load global system props").initCause(e);
+            }
+        }
         if (firstArg.equals("-help") || firstArg.equals("-?")) {
             System.out.println("");
             System.out.println("Usage: java -jar ofbiz.jar [command] [arguments]");