lcsim/src/org/lcsim/conditions
diff -u -r1.8 -r1.9
--- ConditionsReader.java 5 Apr 2006 09:09:10 -0000 1.8
+++ ConditionsReader.java 27 Apr 2007 22:34:10 -0000 1.9
@@ -31,6 +31,7 @@
private static Properties aliases;
private static final File home = new File(FileCache.getCacheRoot(),".lcsim");
private static FileCache cache;
+ private static String DETECTOR_RESOURCE = "/org/lcsim/detector/db/";
/**
* Get a list of available detectors
@@ -120,9 +121,10 @@
if (dirFile.exists() && dirFile.isDirectory()) return new DirectoryConditionsReader(dirFile);
// Look on classpath
- InputStream in = ConditionsReader.class.getResourceAsStream("/org/lcsim/detector/"+name+"/detector.properties");
+ InputStream in = ConditionsReader.class.getResourceAsStream(DETECTOR_RESOURCE + name + "/detector.properties");
if (in != null)
{
+ System.out.println("found conditions in classpath for " + name);
in.close();
return new ClasspathConditionsReader(name);
}
@@ -173,7 +175,7 @@
}
try
{
- InputStream in = ConditionsReader.class.getResourceAsStream("/org/lcsim/detector/alias.properties");
+ InputStream in = ConditionsReader.class.getResourceAsStream(DETECTOR_RESOURCE + "alias.properties");
if (in != null)
{
try
@@ -298,7 +300,7 @@
private String base;
ClasspathConditionsReader(String name) throws IOException
{
- base = "/org/lcsim/detector/"+name+"/";
+ base = DETECTOR_RESOURCE + name + "/";
}
InputStream open(String name, String type) throws IOException
{