hudson.util
Class TextFile

java.lang.Object
  extended by hudson.util.TextFile

public class TextFile
extends Object

Represents a text file. Provides convenience methods for reading and writing to it.

Author:
Kohsuke Kawaguchi

Field Summary
 File file
           
 
Constructor Summary
TextFile(File file)
           
 
Method Summary
 void delete()
           
 boolean exists()
           
 String read()
          Reads the entire contents and returns it.
 String readTrim()
           
 String toString()
           
 void write(String text)
          Overwrites the file by the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

file

public final File file
Constructor Detail

TextFile

public TextFile(File file)
Method Detail

exists

public boolean exists()

delete

public void delete()

read

public String read()
            throws IOException
Reads the entire contents and returns it.

Throws:
IOException

write

public void write(String text)
           throws IOException
Overwrites the file by the given string.

Throws:
IOException

readTrim

public String readTrim()
                throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2013. All Rights Reserved.