[MOBY-guts] biomoby commit

Gary Schiltz gss at pub.open-bio.org
Fri Mar 17 01:12:19 UTC 2006


gss
Thu Mar 16 20:12:18 EST 2006
Update of /home/repository/moby/s-moby/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools
In directory pub.open-bio.org:/tmp/cvs-serv9201/src/org/semanticmoby/ref/tools

Modified Files:
	MOBYProperties.java 
Log Message:
Moved initialization functionality into InitServlet

s-moby/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools MOBYProperties.java,1.6,1.7
===================================================================
RCS file: /home/repository/moby/s-moby/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/MOBYProperties.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/s-moby/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/MOBYProperties.java	2006/03/16 23:19:44	1.6
+++ /home/repository/moby/s-moby/ref-impl/semanticmoby.org/src/org/semanticmoby/ref/tools/MOBYProperties.java	2006/03/17 01:12:18	1.7
@@ -14,9 +14,10 @@
 public abstract class MOBYProperties {
 
     /**
-     * The path to the S-MOBY properties file.
+     * The path to the S-MOBY properties file. It should be located in
+     * the servlet container's conf/ directory.
      */
-    private static String PROP_FILE_NAME = "../smoby.properties";
+    private static String PROP_FILE_NAME = "../../conf/smoby.properties";
 
     /**
      * A static Properties object for accessing the properties file.
@@ -38,12 +39,10 @@
 
         if (required && (value == null)) {
 
-            throw new MissingPropertyException(propName,
-                                               "Property " + propName +
-                                               " not found in " +
-                                               PROP_FILE_NAME);
+            throw new MissingPropertyException(
+            		propName, "Property " + propName +
+                    " not found in " + PROP_FILE_NAME);
         }
-
         return value;
     }
 
@@ -58,7 +57,6 @@
      */
     public static String getProperty(String propName)
                               throws MissingPropertyException {
-
         return getProperty(propName, false);
     }
 
@@ -69,10 +67,10 @@
      * @throws IOException if the file cannot be read
      */
     public static void initProps(ServletContext context)
-                          throws FileNotFoundException, IOException {
-
-        if (props == null)  // Only try to read it once
-         {
+        throws FileNotFoundException, IOException {
+    	
+    	// Only try to read it once
+        if (props == null) {
 
             props = new Properties();
 
@@ -80,9 +78,8 @@
 
             if (path == null) {
 
-                throw new FileNotFoundException("Properties file \"" +
-                                                PROP_FILE_NAME +
-                                                "\" not found");
+                throw new FileNotFoundException(
+                    "Properties file \"" + PROP_FILE_NAME + "\" not found");
             }
 
             props.load(new FileInputStream(path));




More information about the MOBY-guts mailing list