git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-34 - quick hack to see how we can do alignment comparison for splitframes linking...
[jalview.git]
/
src
/
jalview
/
io
/
IdentifyFile.java
diff --git
a/src/jalview/io/IdentifyFile.java
b/src/jalview/io/IdentifyFile.java
index
ea87058
..
baee531
100755
(executable)
--- a/
src/jalview/io/IdentifyFile.java
+++ b/
src/jalview/io/IdentifyFile.java
@@
-35,6
+35,8
@@
import jalview.bin.Console;
public class IdentifyFile
{
public class IdentifyFile
{
+ private static final String XMLHEADER = "<?XML VERSION=\"1.0\" ENCODING=\"UTF-8\" STANDALONE=\"YES\"?>";
+
public FileFormatI identify(Object file, DataSourceType protocol)
throws FileFormatException
{
public FileFormatI identify(Object file, DataSourceType protocol)
throws FileFormatException
{
@@
-134,6
+136,7
@@
public class IdentifyFile
String data;
int bytesRead = 0;
int trimmedLength = 0;
String data;
int bytesRead = 0;
int trimmedLength = 0;
+ boolean isXml = false; // set true if first line is XMLHEADER
boolean lineswereskipped = false;
boolean isBinary = false; // true if length is non-zero and non-printable
// characters are encountered
boolean lineswereskipped = false;
boolean isBinary = false; // true if length is non-zero and non-printable
// characters are encountered
@@
-188,6
+191,10
@@
public class IdentifyFile
reply = FileFormat.ScoreMatrix;
break;
}
reply = FileFormat.ScoreMatrix;
break;
}
+ if (data.startsWith(XMLHEADER) && !lineswereskipped)
+ {
+ isXml = true;
+ }
if (data.startsWith("LOCUS"))
{
reply = FileFormat.GenBank;
if (data.startsWith("LOCUS"))
{
reply = FileFormat.GenBank;
@@
-346,6
+353,12
@@
public class IdentifyFile
reply = FileFormat.Rnaml;
break;
}
reply = FileFormat.Rnaml;
break;
}
+ if (isXml && data.contains(
+ "<NS2:JALVIEWUSERCOLOURS SCHEMENAME=\"SEQUENCE FEATURES\" XMLNS:NS2=\"WWW.JALVIEW.ORG/COLOURS\">"))
+ {
+ reply = FileFormat.FeatureSettings;
+ break;
+ }
}
if ((data.length() < 1) || (data.indexOf("#") == 0))
}
if ((data.length() < 1) || (data.indexOf("#") == 0))