|
From: <lac...@us...> - 2007-10-04 08:58:55
|
Revision: 26
http://td2jira.svn.sourceforge.net/td2jira/?rev=26&view=rev
Author: lacostej
Date: 2007-10-04 01:58:24 -0700 (Thu, 04 Oct 2007)
Log Message:
-----------
Read the td2jira.properties file from classpath instead.
Modified Paths:
--------------
trunk/td2jira/src/td2jira/Config.java
Modified: trunk/td2jira/src/td2jira/Config.java
===================================================================
--- trunk/td2jira/src/td2jira/Config.java 2007-10-04 08:55:54 UTC (rev 25)
+++ trunk/td2jira/src/td2jira/Config.java 2007-10-04 08:58:24 UTC (rev 26)
@@ -1,6 +1,7 @@
package td2jira;
import java.io.FileInputStream;
+import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashMap;
@@ -56,9 +57,13 @@
public static String JIRA_CONNECTOR_IMPLEMENTATION = "jira.connector.implementation=td2jira.jira.xmlrpc.JIRAXmlRpcConnector";
+ private static InputStream getResourceInputStream(String resource) {
+ return Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
+ }
+
public static void load() throws Exception {
if (props.size() != 0) return;
- props.load(new FileInputStream("td2jira.properties"));
+ props.load(getResourceInputStream("td2jira.properties"));
Field[] fields = Config.class.getDeclaredFields();
for (Field field : fields) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|