Merge branch 'feature/JAL-2909bamfiles_features' into features/JAL-2909_bamImport2_11
[jalview.git] / src / jalview / io / IdentifyFile.java
index ff959b0..e65101d 100755 (executable)
@@ -127,14 +127,21 @@ public class IdentifyFile
         {
           // jar files are special - since they contain all sorts of random
           // characters.
-          if (source.inFile != null)
+          if (source.inFile != null || source.getDataName() != null)
           {
-            String fileStr = source.inFile.getName();
+            String fileStr = source.inFile == null ? source.getDataName()
+                    : source.inFile.getName();
             // possibly a Jalview archive.
             if (fileStr.lastIndexOf(".jar") > -1
                     || fileStr.lastIndexOf(".zip") > -1)
             {
               reply = FileFormat.Jalview;
+              // TODO shouldn't there be a break here?
+            }
+            else if (fileStr.lastIndexOf(".bam") > -1)
+            {
+              reply = FileFormat.Bam;
+              break;
             }
           }
           if (!lineswereskipped && data.startsWith("PK"))