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.
Fields inherited from class java.io.Writer |
lock |
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 |
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
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.