[MOBY-guts] biomoby commit

Gary Schlitz gss at pub.open-bio.org
Sat Mar 27 01:27:51 UTC 2004


gss
Fri Mar 26 20:27:51 EST 2004
Update of /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/tools
In directory pub.open-bio.org:/tmp/cvs-serv3440/src/org/smoby/ref/tools

Modified Files:
	URIInvestigator.java 
Log Message:
More reorganization

moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/tools URIInvestigator.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/tools/URIInvestigator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/tools/URIInvestigator.java	2004/03/22 22:11:23	1.1
+++ /home/repository/moby/moby-live/S-MOBY/ref-impl/server/src/org/smoby/ref/tools/URIInvestigator.java	2004/03/27 01:27:51	1.2
@@ -170,16 +170,19 @@
         // Send the request and check the response code
         //
         HTTPResponse response = null;
-        
+
+        int status = -1;
         try {
             response = request.send();
+            status = response.getStatus();
         }
-        catch (HTTPException e) {
-            syncLog.error("Couldn't reach " + providerURI);
+        catch (HTTPException e)
+        {
+            syncLog.warn("Couldn't reach suggested provider " + providerURI);
             return;
         }
         
-        switch (response.getStatus())
+        switch (status)
         {
             case HttpServletResponse.SC_OK:
                 
@@ -190,10 +193,19 @@
                 
                 // Try to parse the Last-Modified header to store in the database
                 //
-                String dateString = response.getHeaderValue(MOBY.LAST_MODIFIED_HEADER);
+                String dateString = "";
                 try {
+                    dateString = response.getHeaderValue(MOBY.LAST_MODIFIED_HEADER);
                     lastModifiedDate = DateParser.parseDate(dateString);
                 }
+                catch (HTTPException e)
+                {
+                    // Log a message about the last modified date not being
+                    // retrievable, but register the graph anyway
+                    //
+                    syncLog.warn("Unable to get Last-Modified date for "
+                                 + providerURI + "; ignoring");
+                }
                 catch (Throwable t)
                 {
                     // Log a message about the last modified date not being
@@ -207,7 +219,16 @@
                 // provider was already registered, then first de-register
                 // its currently stored description graph.
                 //
-                String graphString = response.getBody();
+                String graphString = "";
+                
+                try {
+                	graphString = response.getBody();
+                }
+                catch (HTTPException e)
+                {
+                    syncLog.error("Couldn't retrieve graph from " + providerURI);
+                    return;
+                }
                 
                 Model graph = null;
                 
@@ -275,7 +296,7 @@
                 
                 // Log a message about the failed attempt to contact the URL
                 //
-                syncLog.error("Status " + response.getStatus() + " received while trying " +
+                syncLog.error("Status " + status + " received while trying " +
                              "to contact provider " + providerURI);
                 break;
         }




More information about the MOBY-guts mailing list