com.metamatrix.core.util
Class FileUtil

java.lang.Object
  extended by com.metamatrix.core.util.FileUtil

public class FileUtil
extends java.lang.Object

Utility class for dealing with files. Hides exception handling and file resource management.


Constructor Summary
FileUtil(java.io.File file)
           
FileUtil(java.lang.String fileName)
           
 
Method Summary
 void append(java.lang.String text)
           
 void delete()
           
 java.lang.String read()
           
static java.lang.String read(java.io.Reader reader)
           
 byte[] readBytes()
           
 byte[] readBytesSafe()
           
 java.lang.String readSafe()
           
 void write(java.lang.String text)
           
 void writeBytes(byte[] bytes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil(java.lang.String fileName)

FileUtil

public FileUtil(java.io.File file)
Method Detail

append

public void append(java.lang.String text)

write

public void write(java.lang.String text)

delete

public void delete()

writeBytes

public void writeBytes(byte[] bytes)

read

public java.lang.String read()

readSafe

public java.lang.String readSafe()
                          throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

read

public static java.lang.String read(java.io.Reader reader)

readBytes

public byte[] readBytes()

readBytesSafe

public byte[] readBytesSafe()
                     throws java.io.FileNotFoundException,
                            java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException


Copyright © 2009. All Rights Reserved.