[MOBY-guts] biomoby commit

Eddie Kawas kawas at dev.open-bio.org
Thu Feb 28 17:14:04 UTC 2008


kawas
Thu Feb 28 12:14:03 EST 2008
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client
In directory dev.open-bio.org:/tmp/cvs-serv22574/Java/src/main/org/biomoby/client

Modified Files:
	CentralDigestCachedImpl.java 
Log Message:
removed some unused variables and methods
removed some unused imports
moby-live/Java/src/main/org/biomoby/client CentralDigestCachedImpl.java,1.30,1.31
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java	2008/02/27 16:09:44	1.30
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/CentralDigestCachedImpl.java	2008/02/28 17:14:03	1.31
@@ -8,58 +8,43 @@
 
 package org.biomoby.client;
 
-import java.io.BufferedOutputStream;
 import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Properties;
 import java.util.TreeMap;
 import java.util.Vector;
 
-import org.biomoby.client.rdf.builder.ServiceInstanceRDF;
 import org.biomoby.registry.meta.Registry;
-import org.biomoby.shared.CentralCached;
 import org.biomoby.shared.Central;
 import org.biomoby.shared.MobyDataType;
 import org.biomoby.shared.MobyException;
-import org.biomoby.shared.NoSuccessException;
 import org.biomoby.shared.MobyNamespace;
+import org.biomoby.shared.MobyPrimaryData;
+import org.biomoby.shared.MobyPrimaryDataSet;
+import org.biomoby.shared.MobyPrimaryDataSimple;
+import org.biomoby.shared.MobyRelationship;
 import org.biomoby.shared.MobyResourceRef;
+import org.biomoby.shared.MobySecondaryData;
 import org.biomoby.shared.MobyService;
 import org.biomoby.shared.MobyServiceType;
-import org.biomoby.shared.Utils;
-import org.biomoby.shared.extended.ServiceInstanceParser;
+import org.biomoby.shared.NoSuccessException;
 import org.biomoby.shared.extended.DataTypeParser;
+import org.biomoby.shared.extended.ServiceInstanceParser;
 import org.biomoby.shared.extended.ServiceTypeParser;
-import org.biomoby.shared.MobyPrimaryDataSet;
-import org.biomoby.shared.MobyPrimaryData;
-import org.biomoby.shared.MobyPrimaryDataSimple;
-import org.biomoby.shared.MobySecondaryData;
-import org.biomoby.shared.MobyService;
-import org.biomoby.shared.MobyRelationship;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
-import com.hp.hpl.jena.rdf.model.Model;
-import com.hp.hpl.jena.rdf.model.ModelFactory;
-
 /**
  * An implementation of {@link org.biomoby.shared.CentralAll}, allowing to
  * cache locally results of the cumulative methods so it does not need to access
@@ -86,11 +71,6 @@
     private static org.apache.commons.logging.Log log =
 	org.apache.commons.logging.LogFactory.getLog(CentralDigestCachedImpl.class);
 
-    // for optimalization
-    private Registry reg = null;
-    private boolean namespacesLoaded = false;
-    private boolean serviceTypesLoaded = false;
-
     private int datatype_threshold ;
     private int service_threshold ;
     private int service_type_threshold ;
@@ -113,8 +93,6 @@
     public CentralDigestCachedImpl (String endpoint, String namespace, String cacheDir)
 	throws MobyException {
 	super (endpoint, namespace, cacheDir);
-	reg = new Registry(getRegistryEndpoint(), getRegistryEndpoint(),
-		getRegistryNamespace());
 	
 	datatype_threshold = Integer.getInteger("cache.threshold.datatypes", 7).intValue();
 	if (datatype_threshold < 0 || datatype_threshold > 100)
@@ -267,24 +245,6 @@
 	}
 }
 
-    /**
-     * @return a string of text as obtained from the url
-     * @throws MalformedURLException
-     * @throws IOException
-     */
-    private String getResourceAsString(String ref) throws MobyException,
-	    IOException {
-	StringBuilder rdf = new StringBuilder();
-	String line = null;
-
-	BufferedReader br = new BufferedReader(new InputStreamReader(getResource(ref)));
-	String newline = System.getProperty("line.separator");
-	while ((line = br.readLine()) != null) {
-	    rdf.append(line + newline);
-	}
-	return rdf.toString();
-    }
-
     /***************************************************************************
      * Update services from a moby registry: - get a new LIST_FILE (but do not
      * put it into the cache yet) if failed do nothing (except reporting it) -
@@ -452,8 +412,11 @@
 	    fireEvent (stopS ? AUTHORITIES_CANCELLED : AUTHORITIES_END);
 	    stopS = false;
 	}
-}
-    
+    }
+ 
+    /*
+     * Given a resource name, go to registry and get the URL for it
+     */
     private URL getResourceURL (String resourceName)
 	throws MobyException {
 	MobyResourceRef[] resourceRefs = getResourceRefs();




More information about the MOBY-guts mailing list