Class StringUtils


  • public class StringUtils
    extends Object
    String Utils for ClearCL
    Author:
    royer
    • Constructor Detail

      • StringUtils

        public StringUtils()
    • Method Detail

      • readFileToString

        public static final String readFileToString​(File pFile)
                                             throws IOException
        Reads the content of a file into a String. From: https://stackoverflow.com/questions/326390/how-do-i-create-a-java-string-from-the-contents-of-a-file
        Parameters:
        pFile - file
        Returns:
        String
        Throws:
        IOException - if file cannot be read.
      • writeStringToFile

        public static final void writeStringToFile​(File pFile,
                                                   String pString)
                                            throws IOException
        Writes the content of a string to a file. From: https://stackoverflow.com/questions/1053467/how-do-i-save-a-string-to-a-text-file-using-java
        Parameters:
        pFile - file
        pString - string
        Throws:
        IOException - if file cannot be writen
      • streamToString

        public static String streamToString​(InputStream pResourceAsStream,
                                            String pCharSetName)
        Writes astream to a string.
        Parameters:
        pResourceAsStream - stream
        pCharSetName - charset
        Returns:
        string