com.metaio.tools.io
Class FileWriter

java.lang.Object
  extended by com.metaio.tools.io.FileWriter

public final class FileWriter
extends Object


Constructor Summary
FileWriter()
           
 
Method Summary
static void writeFile(InputStream is, String path, boolean override)
          Write an input stream to the given file path.
static boolean writeToFile(byte[] buffer, int length, String directory, String filename)
          Write a byte buffer to the file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileWriter

public FileWriter()
Method Detail

writeFile

public static void writeFile(InputStream is,
                             String path,
                             boolean override)
                      throws IOException
Write an input stream to the given file path. The directories are created if they don't exist

Parameters:
is - InputStream to write
path - absolute file path
override - if existing file should be replaced with new contents
Throws:
IOException

writeToFile

public static boolean writeToFile(byte[] buffer,
                                  int length,
                                  String directory,
                                  String filename)
                           throws IOException
Write a byte buffer to the file

Parameters:
buffer - buffer to write
length - length of the buffer
directory - directory where file should be written
filename - filename
Returns:
true on success
Throws:
IOException