[MOBY-guts] biomoby commit

Martin Senger senger at dev.open-bio.org
Sun Mar 2 12:45:26 UTC 2008


senger
Sun Mar  2 07:45:25 EST 2008
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client
In directory dev.open-bio.org:/tmp/cvs-serv32345/src/main/org/biomoby/client

Modified Files:
	CentralImpl.java 
Log Message:
Too Many Changes - see docs/ChangeLog

moby-live/Java/src/main/org/biomoby/client CentralImpl.java,1.53,1.54
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java	2008/02/28 16:58:56	1.53
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralImpl.java	2008/03/02 12:45:25	1.54
@@ -21,6 +21,7 @@
 import org.biomoby.shared.NoSuccessException;
 import org.biomoby.shared.PendingCurationException;
 import org.biomoby.shared.MobyResourceRef;
+import org.biomoby.shared.Utils;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.DocumentBuilder;
@@ -772,7 +773,8 @@
 	    Element elem = (Element)list.item (i);
 	    String name = elem.getAttribute ("name");
 	    String auth = elem.getAttribute ("authURI");
-	    Vector v = (results.containsKey (auth) ? (Vector)results.get (auth) : new Vector());
+	    Vector<Object> v =
+		(results.containsKey (auth) ? (Vector)results.get (auth) : new Vector<Object>());
 	    if (onlyNames) {
 		v.addElement (name);
 	    } else {
@@ -1597,7 +1599,7 @@
 	throws MobyException {
 
 	// parse returned XML
-	Vector v = new Vector();
+	Vector<String> v = new Vector<String>();
 	Document document = loadDocument (new ByteArrayInputStream (result.getBytes()));
 	NodeList list = document.getElementsByTagName ("Relationship");
 	for (int i = 0; i < list.getLength(); i++) {
@@ -1661,7 +1663,7 @@
 	    Element elem = (Element)list.item (i);
 	    String relType = elem.getAttribute ("relationshipType");
 	    NodeList children = elem.getChildNodes();
-	    Vector v = new Vector();
+	    Vector<String> v = new Vector<String>();
 	    for (int j = 0; j < children.getLength(); j++) {
 		if (children.item (j).getNodeName().equals ("objectType")) {
 		    v.addElement (getFirstValue (children.item (j)));
@@ -1707,7 +1709,7 @@
 			    });
 
 	// parse returned XML
-	Vector v = new Vector();
+	Vector<String> v = new Vector<String>();
 	Document document = loadDocument (new ByteArrayInputStream (result.getBytes()));
 	NodeList list = document.getElementsByTagName ("Relationship");
 
@@ -1755,11 +1757,11 @@
      * Parses and imports the following XML.
      * <pre>
      * &lt;resourceURLs&gt;
-     *   &lt;Resource name="Service"         url="..." type="..."/&gt;
-     *   &lt;Resource name="Object"          url="..." type="..."/&gt;
-     *   &lt;Resource name="Namespace"       url="..." type="..."/&gt;
-     *   &lt;Resource name="ServiceInstance" url="..." type="..."/&gt;
-     *   &lt;Resource name="Full"            url="..." type="..."/&gt;
+     *   &lt;Resource name="Service"         url="..." /&gt;
+     *   &lt;Resource name="Object"          url="..." /&gt;
+     *   &lt;Resource name="Namespace"       url="..." /&gt;
+     *   &lt;Resource name="ServiceInstance" url="..." /&gt;
+     *   &lt;Resource name="Full"            url="..." /&gt;
      * &lt;/resourceURLs&gt;
      * </pre>
      *************************************************************************/
@@ -1775,7 +1777,7 @@
 					new Object[] {});
 
 	// parse returned XML
-	Vector v = new Vector();
+	Vector<MobyResourceRef> v = new Vector<MobyResourceRef>();
 	Document document = loadDocument (new ByteArrayInputStream (result.getBytes()));
 	NodeList list = document.getElementsByTagName ("Resource");
 	for (int i = 0; i < list.getLength(); i++) {
@@ -1809,12 +1811,7 @@
 	MobyResourceRef[] resourceRefs = getResourceRefs();
 	for (int i = 0; i < resourceRefs.length; i++) {
 	    if (resourceName.equalsIgnoreCase (resourceRefs[i].getResourceName())) {
-		URL url = resourceRefs[i].getResourceLocation();
-		try {
-		    return url.openStream();
-		} catch (java.io.IOException e2) {
-		    throw new MobyException (e2.toString(), e2);
-		}
+		return Utils.getInputStream (resourceRefs[i].getResourceLocation());
 	    }
 	}
 	throw new MobyException ("No resource found for '" + resourceName + "'.");




More information about the MOBY-guts mailing list