org.jcon.io
Class IOUtilities

java.lang.Object
  extended by org.jcon.io.IOUtilities

public class IOUtilities
extends java.lang.Object

Some general I/O utility methods.

Author:
Paul Reavis

Constructor Summary
IOUtilities()
           
 
Method Summary
static void copy(java.io.File original, java.io.File copy)
          Copies a file.
static void deleteContents(java.io.File dir)
          Deletes all files in a directory.
static java.lang.String slurp(java.io.File file)
          Slurps a text file in as a single big String.
static java.lang.String slurp(java.io.Reader innie)
          Slurps the contents of a Reader in as a single big String.
static java.lang.String slurp(java.lang.String filename)
          Slurps a text file in as a single big String.
static void spit(java.io.File file, java.lang.String contents)
          Spits a String out into a text file.
static void spit(java.lang.String filename, java.lang.String contents)
          Spits a String out into a text file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtilities

public IOUtilities()
Method Detail

slurp

public static java.lang.String slurp(java.lang.String filename)
                              throws java.io.IOException
Slurps a text file in as a single big String.

Throws:
java.io.IOException

slurp

public static java.lang.String slurp(java.io.File file)
                              throws java.io.IOException
Slurps a text file in as a single big String.

Throws:
java.io.IOException

slurp

public static java.lang.String slurp(java.io.Reader innie)
                              throws java.io.IOException
Slurps the contents of a Reader in as a single big String.

Throws:
java.io.IOException

spit

public static void spit(java.lang.String filename,
                        java.lang.String contents)
                 throws java.io.IOException
Spits a String out into a text file.

Throws:
java.io.IOException

spit

public static void spit(java.io.File file,
                        java.lang.String contents)
                 throws java.io.IOException
Spits a String out into a text file.

Throws:
java.io.IOException

copy

public static void copy(java.io.File original,
                        java.io.File copy)
                 throws java.io.IOException
Copies a file.

Throws:
java.io.IOException

deleteContents

public static void deleteContents(java.io.File dir)
Deletes all files in a directory.