Copyright 2002 by aragost

com.aragost.io
Class InPlaceFileWriter

java.lang.Object
  |
  +--java.io.Writer
        |
        +--java.io.OutputStreamWriter
              |
              +--java.io.FileWriter
                    |
                    +--com.aragost.io.InPlaceFileWriter

public class InPlaceFileWriter
extends java.io.FileWriter

An InPlaceFileWriter can be used to write to a file, while at the same time reading from it. What is actually happening is that it is written to a temporary tile, and when the writer is closed, the temporary file is renamed to the "real" file.


Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
InPlaceFileWriter(java.io.File f)
          Creates new InPlaceFileWriter
InPlaceFileWriter(java.io.File f, java.io.File backupFile)
           
 
Method Summary
 void close()
           
 java.io.File getBackupFile()
          Getter for property backupFile.
 void setBackupFile(java.io.File backupFile)
          Setter for property backupFile.
 
Methods inherited from class java.io.OutputStreamWriter
flush, getEncoding, write, write, write
 
Methods inherited from class java.io.Writer
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InPlaceFileWriter

public InPlaceFileWriter(java.io.File f)
                  throws java.io.IOException
Creates new InPlaceFileWriter


InPlaceFileWriter

public InPlaceFileWriter(java.io.File f,
                         java.io.File backupFile)
                  throws java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Overrides:
close in class java.io.OutputStreamWriter
java.io.IOException

getBackupFile

public java.io.File getBackupFile()
Getter for property backupFile.

Returns:
Value of property backupFile.

setBackupFile

public void setBackupFile(java.io.File backupFile)
Setter for property backupFile.

Parameters:
backupFile - New value of property backupFile.

Copyright 2002 by aragost