X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FHtmlFile.java;h=af3fb5dd97d0267a94fe59a8852385ee1d173f1e;hb=fb4028aee26fec7707500b32632ce27521bcf3c4;hp=d19a2030a2982ba1674898d1a740d6dbb06101a3;hpb=a8362b85de4f21440433bc9385bd9b3a24354532;p=jalview.git diff --git a/src/jalview/io/HtmlFile.java b/src/jalview/io/HtmlFile.java index d19a203..af3fb5d 100644 --- a/src/jalview/io/HtmlFile.java +++ b/src/jalview/io/HtmlFile.java @@ -27,13 +27,8 @@ import jalview.api.FeaturesDisplayedI; import jalview.datamodel.ColumnSelection; import jalview.datamodel.SequenceI; -import java.io.BufferedReader; -import java.io.File; import java.io.IOException; -import java.io.InputStreamReader; import java.io.StringReader; -import java.net.URL; -import java.util.Objects; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; @@ -65,9 +60,10 @@ public class HtmlFile extends AlignFile implements ComplexAlignFile super(source); } - public HtmlFile(String inFile, String type) throws IOException + public HtmlFile(String inFile, DataSourceType sourceType) + throws IOException { - super(inFile, type); + super(inFile, sourceType); } @Override @@ -124,7 +120,7 @@ public class HtmlFile extends AlignFile implements ComplexAlignFile } @Override - public String print() + public String print(SequenceI[] sqs, boolean jvsuffix) { throw new UnsupportedOperationException( "Print method of HtmlFile is not supported!"); @@ -195,52 +191,4 @@ public class HtmlFile extends AlignFile implements ComplexAlignFile return new PDBFeatureSettings(); } - /** - * Read a template file content as string - * - * @param file - * - the file to be read - * @return File content as String - * @throws IOException - */ - public static String readFileAsString(File file) throws IOException - { - InputStreamReader isReader = null; - BufferedReader buffReader = null; - StringBuilder sb = new StringBuilder(); - Objects.requireNonNull(file, "File must not be null!"); - @SuppressWarnings("deprecation") - URL url = file.toURL(); - if (url != null) - { - try - { - isReader = new InputStreamReader(url.openStream()); - buffReader = new BufferedReader(isReader); - String line; - String lineSeparator = System.getProperty("line.separator"); - while ((line = buffReader.readLine()) != null) - { - sb.append(line).append(lineSeparator); - } - - } catch (Exception ex) - { - ex.printStackTrace(); - } finally - { - if (isReader != null) - { - isReader.close(); - } - - if (buffReader != null) - { - buffReader.close(); - } - } - } - return sb.toString(); - } - }