Package org.spockframework.util
Class IoUtil
- java.lang.Object
-
- org.spockframework.util.IoUtil
-
public class IoUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description IoUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseQuietly(java.io.Closeable... closeables)static voidcopyFile(java.io.File source, java.io.File target)static voidcopyStream(java.io.InputStream in, java.io.OutputStream out)static voidcreateDirectory(java.io.File dir)static java.lang.StringgetText(java.io.File path)Returns the text read from the given file as a String.static java.lang.StringgetText(java.io.InputStream stream)Returns the text read from the given stream as a String.static java.lang.StringgetText(java.io.Reader reader)Returns the text read from the given reader as a String.
-
-
-
Method Detail
-
closeQuietly
public static void closeQuietly(java.io.Closeable... closeables)
-
getText
public static java.lang.String getText(java.io.Reader reader) throws java.io.IOExceptionReturns the text read from the given reader as a String. Closes the given reader upon return.- Throws:
java.io.IOException
-
getText
public static java.lang.String getText(java.io.File path) throws java.io.IOExceptionReturns the text read from the given file as a String.- Throws:
java.io.IOException
-
getText
public static java.lang.String getText(java.io.InputStream stream) throws java.io.IOExceptionReturns the text read from the given stream as a String. Closes the given stream upon return.- Throws:
java.io.IOException
-
createDirectory
public static void createDirectory(java.io.File dir) throws java.io.IOException- Throws:
java.io.IOException
-
copyStream
public static void copyStream(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException- Throws:
java.io.IOException
-
copyFile
public static void copyFile(java.io.File source, java.io.File target) throws java.io.FileNotFoundException, java.io.IOException- Throws:
java.io.FileNotFoundExceptionjava.io.IOException
-
-