Package antlr
Class PreservingFileWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.OutputStreamWriter
-
- java.io.FileWriter
-
- antlr.PreservingFileWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.Appendable,java.lang.AutoCloseable
public class PreservingFileWriter extends java.io.FileWriterPreservingFileWriter only overwrites target if the new file is different. Mainly added in order to prevent big and unnecessary recompiles in C++ projects. I/O is buffered.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.Filetarget_fileprotected java.io.Filetmp_file
-
Constructor Summary
Constructors Constructor Description PreservingFileWriter(java.lang.String file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the file and see if the actual target is different if so the target file is overwritten by the copy.
-
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionClose the file and see if the actual target is different if so the target file is overwritten by the copy. If not we do nothing- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStreamWriter- Throws:
java.io.IOException
-
-