Index: Jelly.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/Jelly.java,v
retrieving revision 1.14
diff -u -r1.14 Jelly.java
--- Jelly.java	9 Aug 2002 19:11:56 -0000	1.14
+++ Jelly.java	1 Oct 2002 20:32:02 -0000
@@ -65,10 +65,13 @@
 import java.io.File;
 import java.io.FileWriter;
 import java.io.InputStream;
+import java.io.FileInputStream;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.Enumeration;
+import java.util.Properties;
 
 import org.apache.commons.jelly.parser.XMLParser;
 import org.apache.commons.logging.Log;
@@ -98,6 +101,11 @@
     
     
     public Jelly() {
+		try {
+			loadJellyProperties();
+		}
+		catch(Exception e) {
+		}
     }
     
     public static void main(String[] args) throws Exception {
@@ -169,6 +177,35 @@
         }
         return script;
     }
+
+	 private void loadJellyProperties() throws Exception {
+		InputStream is = null;
+
+		String userDir = System.getProperty("user.home");
+		String fileSep = System.getProperty("file.separator");
+		File f = new File(userDir + fileSep + "jelly.properties");
+		if(f.exists()) {
+			is = new FileInputStream(f);
+			loadProperties(is);
+		}
+
+		f = new File("jelly.properties");
+		if(f.exists()) {
+			is = new FileInputStream(f);
+			loadProperties(is);
+		}
+	 }
+
+	private void loadProperties(InputStream is) throws Exception {
+		Properties props = new Properties();
+		props.load(is);
+		Enumeration enum = props.propertyNames();
+		while(enum.hasMoreElements()) {
+			String key = (String)enum.nextElement();
+			String value = props.getProperty(key);
+			System.getProperties().setProperty(key, value);
+		}
+	}
     
     
     // Properties
