Print

Print


Author: [log in to unmask]
Date: Wed Oct 28 08:04:32 2015
New Revision: 3901

Log:
Fix loading of steering resources when not using bin jar.

Modified:
    java/trunk/monitoring-app/pom.xml
    java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/EventProcessing.java
    java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/util/ResourceUtil.java

Modified: java/trunk/monitoring-app/pom.xml
 =============================================================================
--- java/trunk/monitoring-app/pom.xml	(original)
+++ java/trunk/monitoring-app/pom.xml	Wed Oct 28 08:04:32 2015
@@ -52,10 +52,5 @@
             <groupId>org.reflections</groupId>
             <artifactId>reflections</artifactId>
         </dependency>
-        <dependency>
-            <groupId>javax.jlfgr</groupId>
-            <artifactId>jlfgr</artifactId>
-            <version>1.0</version>
-        </dependency>
     </dependencies>
 </project>

Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/EventProcessing.java
 =============================================================================
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/EventProcessing.java	(original)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/EventProcessing.java	Wed Oct 28 08:04:32 2015
@@ -29,6 +29,7 @@
 import org.hps.record.et.EtConnection;
 import org.hps.record.et.EtStationThread;
 import org.hps.record.evio.EvioDetectorConditionsProcessor;
+import org.hps.steering.SteeringFileCatalog;
 import org.jlab.coda.et.EtConstants;
 import org.jlab.coda.et.exception.EtClosedException;
 import org.jlab.coda.et.exception.EtException;
@@ -617,10 +618,10 @@
      * @param steering the steering resource
      * @throws IOException if there is a problem accessing or setting up the resource
      */
-    private void setupSteeringResource(final String steering) throws IOException {
-        final InputStream is = this.getClass().getClassLoader().getResourceAsStream(steering);
+    private void setupSteeringResource(final String resource) throws IOException {
+        final InputStream is = SteeringFileCatalog.getInputStream(resource);
         if (is == null) {
-            throw new IOException("Steering resource is not accessible or does not exist.");
+            throw new IOException("Resource " + resource + " is not accessible or does not exist.");
         }
         this.sessionState.jobManager.setup(is);
         is.close();

Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/util/ResourceUtil.java
 =============================================================================
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/util/ResourceUtil.java	(original)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/util/ResourceUtil.java	Wed Oct 28 08:04:32 2015
@@ -1,18 +1,7 @@
 package org.hps.monitoring.application.util;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.JarURLConnection;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
 import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
 import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
 
 import org.hps.conditions.database.DatabaseConditionsManager;
 import org.hps.record.LCSimEventBuilder;