Building Parsers with Java

sjm.utensil
Class FileString

java.lang.Object
  |
  +--sjm.utensil.FileString

public class FileString
extends java.lang.Object

This class has a static method that returns a file's characters as a single String.


Constructor Summary
FileString()
           
 
Method Summary
static java.lang.String stringFromFileNamed(java.lang.String fileName)
          Returns a string that represents the contents of a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileString

public FileString()
Method Detail

stringFromFileNamed

public static java.lang.String stringFromFileNamed(java.lang.String fileName)
                                            throws java.io.IOException
Returns a string that represents the contents of a file.
Parameters:
fileName - the name of the file to read
Returns:
string the contents of a file as a String
Throws:
java.io.IOException - if the file is not found, or if there is any problem reading the file

by Steve Metsker