JAL-2388 Renamed viewport position props to viewport ranges
[jalview.git] / src / jalview / io / HtmlFile.java
index d19a203..af3fb5d 100644 (file)
@@ -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();
-  }
-
 }