ca.bc.gov.webade.developer.util
Class IOUtils

java.lang.Object
  extended byca.bc.gov.webade.developer.util.IOUtils

public final class IOUtils
extends java.lang.Object

Input / Ouput Utilities.

Author:
Vivid Solutions Inc

Constructor Summary
IOUtils()
           
 
Method Summary
static java.lang.String createTempFileFromClasspath(java.lang.String fileName, java.lang.String fileSuffix)
          Create a temp file reading the contents from a resource in the classpath.
static void streamToFile(java.io.InputStream stream, java.io.File file)
           
static java.lang.String streamToString(java.io.InputStream stream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtils

public IOUtils()
Method Detail

streamToString

public static java.lang.String streamToString(java.io.InputStream stream)
                                       throws java.io.IOException
Throws:
java.io.IOException

streamToFile

public static void streamToFile(java.io.InputStream stream,
                                java.io.File file)
                         throws java.io.IOException
Throws:
java.io.IOException

createTempFileFromClasspath

public static java.lang.String createTempFileFromClasspath(java.lang.String fileName,
                                                           java.lang.String fileSuffix)
Create a temp file reading the contents from a resource in the classpath.

Parameters:
fileName - The file name of the resource
fileSuffix - The file suffix of the resource
Returns:
The path to the created temp file or null if the file could not be created.