JAL-2446 merged to spike branch
[jalview.git] / src / jalview / io / StructureFile.java
index d39ab38..ab220f0 100644 (file)
@@ -42,14 +42,8 @@ import MCview.PDBChain;
 
 public abstract class StructureFile extends AlignFile
 {
-
   private String id;
 
-  public enum StructureFileType
-  {
-    PDB, MMCIF, MMTF
-  };
-
   private PDBEntry.Type dbRefType;
 
   /**
@@ -412,7 +406,8 @@ public abstract class StructureFile extends AlignFile
    * make a friendly ID string.
    * 
    * @param dataName
-   * @return truncated dataName to after last '/'
+   * @return truncated dataName to after last '/' and pruned .extension if
+   *         present
    */
   protected String safeName(String dataName)
   {
@@ -421,6 +416,9 @@ public abstract class StructureFile extends AlignFile
     {
       dataName = dataName.substring(p + 1);
     }
+    if(dataName.indexOf(".") > -1){
+      dataName = dataName.substring(0, dataName.lastIndexOf("."));
+    }
     return dataName;
   }
 
@@ -488,20 +486,4 @@ public abstract class StructureFile extends AlignFile
   {
     this.pdbIdAvailable = pdbIdAvailable;
   }
-
-  public static boolean isStructureFile(String fileType)
-  {
-    if (fileType == null)
-    {
-      return false;
-    }
-    for (StructureFileType sfType : StructureFileType.values())
-    {
-      if (sfType.name().equalsIgnoreCase(fileType))
-      {
-        return true;
-      }
-    }
-    return false;
-  }
 }