X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAnnotationFile.java;h=6e121b3605294505b1e4433b740564aaadca77d6;hb=ee198b3ca3687f18a2ee186f4e7c7330f4ea30f0;hp=d738882b055e2da646652aee3dc5ca6d1294cb99;hpb=0bec4854366c4bc4608ed0d7dc1506fc6afe2285;p=jalview.git diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index d738882..6e121b3 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -661,7 +661,7 @@ public class AnnotationFile String refSeqId = null; public boolean annotateAlignmentView(AlignViewportI viewport, - String file, String protocol) + String file, DataSourceType protocol) { ColumnSelection colSel = viewport.getColumnSelection(); if (colSel == null) @@ -679,31 +679,31 @@ public class AnnotationFile } public boolean readAnnotationFile(AlignmentI al, String file, - String protocol) + DataSourceType sourceType) { - return readAnnotationFile(al, null, file, protocol); + return readAnnotationFile(al, null, file, sourceType); } public boolean readAnnotationFile(AlignmentI al, ColumnSelection colSel, - String file, String protocol) + String file, DataSourceType sourceType) { BufferedReader in = null; try { - if (protocol.equals(AppletFormatAdapter.FILE)) + if (sourceType == DataSourceType.FILE) { in = new BufferedReader(new FileReader(file)); } - else if (protocol.equals(AppletFormatAdapter.URL)) + else if (sourceType == DataSourceType.URL) { URL url = new URL(file); in = new BufferedReader(new InputStreamReader(url.openStream())); } - else if (protocol.equals(AppletFormatAdapter.PASTE)) + else if (sourceType == DataSourceType.PASTE) { in = new BufferedReader(new StringReader(file)); } - else if (protocol.equals(AppletFormatAdapter.CLASSLOADER)) + else if (sourceType == DataSourceType.CLASSLOADER) { java.io.InputStream is = getClass().getResourceAsStream("/" + file); if (is != null)