Class StringUtils
- java.lang.Object
-
- net.haesleinhuepf.clij.clearcl.util.StringUtils
-
public class StringUtils extends Object
String Utils for ClearCL- Author:
- royer
-
-
Constructor Summary
Constructors Constructor Description StringUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringreadFileToString(File pFile)Reads the content of a file into a String.static StringstreamToString(InputStream pResourceAsStream, String pCharSetName)Writes astream to a string.static voidwriteStringToFile(File pFile, String pString)Writes the content of a string to a file.
-
-
-
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- filepString- string- Throws:
IOException- if file cannot be writen
-
streamToString
public static String streamToString(InputStream pResourceAsStream, String pCharSetName)
Writes astream to a string.- Parameters:
pResourceAsStream- streampCharSetName- charset- Returns:
- string
-
-