[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Fri Jun 8 20:30:22 UTC 2007


gordonp
Fri Jun  8 16:30:22 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/meta
In directory dev.open-bio.org:/tmp/cvs-serv29870/src/main/org/biomoby/registry/meta

Modified Files:
	Registry.java 
Log Message:
Code revamp to deal with new disk cache
moby-live/Java/src/main/org/biomoby/registry/meta Registry.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/meta/Registry.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/meta/Registry.java	2007/05/31 13:42:51	1.2
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/meta/Registry.java	2007/06/08 20:30:22	1.3
@@ -8,6 +8,10 @@
 
 package org.biomoby.registry.meta;
 
+import org.biomoby.client.CentralImpl;
+import org.biomoby.shared.MobyResourceRef;
+import org.biomoby.shared.MobyException;
+
 /**
  * A container for meta data about a BioMoby registry. <p>
  *
@@ -172,4 +176,23 @@
 	isPublic = value;
     }
 
+    /**
+     * Learn the RDF location for resources of the registry.
+     *
+     * @param resourceName one of the org.biomoby.shared.Central RESOURCE constants
+     *
+     * @return the URL of the resource, or null if the resource does not exist
+     */
+    public static java.net.URL findResourceURL(Registry reg, String resourceName) throws MobyException{
+	CentralImpl central = new CentralImpl(reg.getEndpoint());
+	MobyResourceRef[] resources = central.getResourceRefs();
+	for(MobyResourceRef resource: resources){
+	    if(resourceName.equals(resource.getResourceName())){
+		return resource.getResourceLocation();
+	    }
+	}
+	System.err.println("Error! Could not find the data type resource from the registry " + reg.getSynonym());
+	return null;
+    }
+
 }




More information about the MOBY-guts mailing list