Buglet - buglet.sourceforge.org

org.buglet.util
Class FileUtil

java.lang.Object
  |
  +--org.buglet.util.FileUtil

public class FileUtil
extends java.lang.Object

This class is a helper for the job class and is used to deal with the file I/O stuff for the comment, query, env vars, and events.

Author:
Stephen Brown

Field Summary
(package private)  java.io.BufferedReader bufferHandle
          Buffered reader used in internal non static methods.
(package private) static org.apache.log4j.Category log
           
 
Constructor Summary
FileUtil()
           
 
Method Summary
static void append(java.lang.StringBuffer value, java.lang.String dir, java.lang.String filetype)
          Appends the StringBuffer to the given file in the given directory.
static void append(java.lang.String value, java.lang.String dir, java.lang.String filetype)
          Appends the String to the given file in the given directory.
static java.lang.String read(java.lang.String file)
           
static java.lang.String read(java.lang.String dir, java.lang.String filetype)
          Reads the given file from the given directory and returns it as a String.
 java.lang.String readline()
          Reads one line from the file which should have been initialized using SetupRead.
 void SetupRead(java.lang.String dir, java.lang.String filetype)
          Initialize a read on a file, opend the file, leaves the bufferHandle initialized for reading the file.
static void write(java.lang.StringBuffer value, java.lang.String dir, java.lang.String filetype)
          Writes the StringBuffer to a new file, overwriting the file if it exists.
static void write(java.lang.String value, java.lang.String dir, java.lang.String filetype)
          Writes the String to a new file, overwriting the file if it exists.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

static org.apache.log4j.Category log

bufferHandle

java.io.BufferedReader bufferHandle
Buffered reader used in internal non static methods.
Constructor Detail

FileUtil

public FileUtil()
Method Detail

append

public static void append(java.lang.String value,
                          java.lang.String dir,
                          java.lang.String filetype)
Appends the String to the given file in the given directory.
Parameters:
value -  
dir -  
filetype -  

append

public static void append(java.lang.StringBuffer value,
                          java.lang.String dir,
                          java.lang.String filetype)
Appends the StringBuffer to the given file in the given directory.
Parameters:
value -  
dir -  
filetype -  

write

public static void write(java.lang.String value,
                         java.lang.String dir,
                         java.lang.String filetype)
Writes the String to a new file, overwriting the file if it exists.
Parameters:
value -  
dir -  
filetype -  

write

public static void write(java.lang.StringBuffer value,
                         java.lang.String dir,
                         java.lang.String filetype)
Writes the StringBuffer to a new file, overwriting the file if it exists.
Parameters:
value -  
dir -  
filetype -  

read

public static java.lang.String read(java.lang.String dir,
                                    java.lang.String filetype)
Reads the given file from the given directory and returns it as a String.
Parameters:
dir -  
filetype -  

read

public static java.lang.String read(java.lang.String file)

SetupRead

public void SetupRead(java.lang.String dir,
                      java.lang.String filetype)
Initialize a read on a file, opend the file, leaves the bufferHandle initialized for reading the file.
Parameters:
dir -  
filetype -  

readline

public java.lang.String readline()
Reads one line from the file which should have been initialized using SetupRead.

Buglet - buglet.sourceforge.org

Copyright © 2001 58k.com Inc. All Rights Reserved