Class ConvertToString

java.lang.Object
research.ch.cern.unicos.utilities.ConvertToString

public class ConvertToString extends Object
Utility class to get a String from different sources
Author:
Ivan Prieto Barreiro
  • Method Details

    • getString

      public static String getString(File file) throws IOException
      Get the content of a File as a String.
      Parameters:
      file - The file where to read the string.
      Returns:
      Throws:
      IOException
    • getString

      public static String getString(String filePath) throws IOException
      Get the content of a file as a String.
      Parameters:
      filePath - The absolute path of the file.
      Returns:
      Throws:
      IOException
    • getString

      public static String getString(InputStream is) throws IOException
      Get the content of an InputStream as a String.
      Parameters:
      is - The InputStream where to get the String.
      Returns:
      Throws:
      IOException