Home | Download | News | Wiki | About ANTLR | Feedback | Support | Bugs


Latest version is 2.7.7.
Download now! »

Download
» Home
» Download
» News
»Using ANTLR
» Documentation
» Wiki
» FAQ
» Articles
» Grammars
» File Sharing
» Code API
» Tech Support
» Bug Tracking
»About ANTLR
» What is ANTLR
» Why use ANTLR
» Showcase
» Testimonials
» Getting Started
» Software License
» ANTLR WebLogs
» ANTLR Workshops
»StringTemplate
»TML
»PCCTS
»Feedback
»Credits
»Contact


Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)

Search



PreservingFileWriter


antlr
Class PreservingFileWriter

java.lang.Object
  extended byjava.io.Writer
      extended byjava.io.OutputStreamWriter
          extended byjava.io.FileWriter
              extended byantlr.PreservingFileWriter

public class PreservingFileWriter
extends java.io.FileWriter

PreservingFileWriter 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.


Constructor Summary
PreservingFileWriter(java.lang.String file)
           
 
Method Summary
 void close()
          Close the file and see if the actual target is different if so the target file is overwritten by the copy.
 
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreservingFileWriter

public PreservingFileWriter(java.lang.String file)
                     throws java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Close 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

Throws:
java.io.IOException