X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FAnnotationFile.java;h=82e71b546fc42c5e991a2e902a86802ad5f49419;hb=7d67fb613ec026dc9a265e351e7fab542e3f1d61;hp=61a30f82c7cf801a07f8129c4ccdc46c1204e2b5;hpb=3e29fb36af9c48e07837e32b7e99c081b2461b2f;p=jalview.git diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 61a30f8..82e71b5 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -660,7 +660,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) @@ -678,31 +678,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)