JAL-3949 Complete new abstracted logging framework in jalview.log. Updated log calls...
[jalview.git] / src / jalview / ws / dbsources / Xfam.java
index e336c7d..fd8512f 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.ws.dbsources;
 
+import java.util.Locale;
+
 import jalview.bin.Cache;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.DBRefEntry;
@@ -36,13 +38,17 @@ import jalview.ws.seqfetcher.DbSourceProxyImpl;
  */
 public abstract class Xfam extends DbSourceProxyImpl
 {
-
   public Xfam()
   {
     super();
   }
 
-  protected abstract String getDomain();
+  /**
+   * the base URL for this Xfam-like service
+   * 
+   * @return
+   */
+  protected abstract String getURLPrefix();
 
   @Override
   public abstract String getDbVersion();
@@ -59,10 +65,7 @@ public abstract class Xfam extends DbSourceProxyImpl
     // TODO: trap HTTP 404 exceptions and return null
     String xfamUrl = getURL(queries);
 
-    if (Cache.log != null)
-    {
-      Cache.log.debug("XFAM URL for retrieval is: " + xfamUrl);
-    }
+    Cache.debug("XFAM URL for retrieval is: " + xfamUrl);
 
     AlignmentI rcds = new FormatAdapter().readFile(xfamUrl,
             DataSourceType.URL, FileFormat.Stockholm);
@@ -71,11 +74,11 @@ public abstract class Xfam extends DbSourceProxyImpl
     {
       rcds.getSequenceAt(s).addDBRef(new DBRefEntry(getXfamSource(),
               // getDbSource(),
-              getDbVersion(), queries.trim().toUpperCase()));
+              getDbVersion(), queries.trim().toUpperCase(Locale.ROOT)));
       if (!getDbSource().equals(getXfamSource()))
       { // add the specific ref too
         rcds.getSequenceAt(s).addDBRef(new DBRefEntry(getDbSource(),
-                getDbVersion(), queries.trim().toUpperCase()));
+                getDbVersion(), queries.trim().toUpperCase(Locale.ROOT)));
       }
     }
     stopQuery();
@@ -84,7 +87,7 @@ public abstract class Xfam extends DbSourceProxyImpl
 
   String getURL(String queries)
   {
-    return getDomain() + "/family/" + queries.trim().toUpperCase()
+    return getURLPrefix() + "/family/" + queries.trim().toUpperCase(Locale.ROOT)
             + getURLSuffix();
   }