lapisx.io
Class FileUtil

java.lang.Object
  extended bylapisx.io.FileUtil

public abstract class FileUtil
extends Object


Constructor Summary
FileUtil()
           
 
Method Summary
static String load(File f)
          Load a file into a string.
static String load(InputStream in)
          Load a stream into a string.
static String load(Reader r)
          Load a reader stream into a string.
static void save(File f, String s)
          Save a file (represented as a string) to disk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

load

public static String load(File f)
                   throws IOException
Load a file into a string.

Parameters:
f - Filename to load
Returns:
Contents of file as a string, loaded through a Reader
Throws:
IOException

load

public static String load(InputStream in)
                   throws IOException
Load a stream into a string.

Parameters:
in - Stream to load
Returns:
Contents of stream as a string
Throws:
IOException

load

public static String load(Reader r)
                   throws IOException
Load a reader stream into a string.

Parameters:
r - Reader stream to load
Returns:
Contents of reader stream as a string
Throws:
IOException

save

public static void save(File f,
                        String s)
                 throws IOException
Save a file (represented as a string) to disk.

Parameters:
f - Filename to save
s - Contents of file
Throws:
IOException