JTools

org.jtools.io.psoutput
Class OmittableOutputFile

java.lang.Object
  extended by org.jtools.io.psoutput.OmittableOutputFile
All Implemented Interfaces:
PrintStreamOutput

public class OmittableOutputFile
extends Object
implements PrintStreamOutput

PrintStreamOutput implementation that enables file omitting if files are identical.


Nested Class Summary
 class OmittableOutputFile.DifferentLine
           
 
Nested classes/interfaces inherited from interface org.jtools.io.psoutput.PrintStreamOutput
PrintStreamOutput.Result
 
Constructor Summary
OmittableOutputFile(File dir)
           
OmittableOutputFile(File dir, File cmpDir, String tmpFilePrefix, String tmpFileSuffix, boolean omitOnIdent, long fileTime)
           
 
Method Summary
 PrintStreamOutput.Result execute()
          executes operations after all content is written to the printstream.
 File getCmpFile()
           
 File getFile()
           
 String getOutputFilename(String defaultName)
          get the OutputFilename if available or defaultName if not.
 PrintStream getPrintStream()
          get the PrintStream to write to.
 File getTmpFile()
           
 void setCmpFilename(String name)
          set the filename to compare with.
 void setFilename(String name)
          set the filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OmittableOutputFile

public OmittableOutputFile(File dir)
                    throws IOException
Throws:
IOException

OmittableOutputFile

public OmittableOutputFile(File dir,
                           File cmpDir,
                           String tmpFilePrefix,
                           String tmpFileSuffix,
                           boolean omitOnIdent,
                           long fileTime)
                    throws IOException
Throws:
IOException
Method Detail

execute

public PrintStreamOutput.Result execute()
                                 throws IOException
Description copied from interface: PrintStreamOutput
executes operations after all content is written to the printstream.

Specified by:
execute in interface PrintStreamOutput
Throws:
IOException

getCmpFile

public File getCmpFile()

getFile

public File getFile()

getOutputFilename

public String getOutputFilename(String defaultName)
Description copied from interface: PrintStreamOutput
get the OutputFilename if available or defaultName if not.

Specified by:
getOutputFilename in interface PrintStreamOutput

getPrintStream

public PrintStream getPrintStream()
                           throws IOException
Description copied from interface: PrintStreamOutput
get the PrintStream to write to.

Specified by:
getPrintStream in interface PrintStreamOutput
Throws:
IOException

getTmpFile

public File getTmpFile()
                throws IOException
Throws:
IOException

setCmpFilename

public void setCmpFilename(String name)
Description copied from interface: PrintStreamOutput
set the filename to compare with.

Specified by:
setCmpFilename in interface PrintStreamOutput

setFilename

public void setFilename(String name)
Description copied from interface: PrintStreamOutput
set the filename.

Specified by:
setFilename in interface PrintStreamOutput

JTools

© 2000-2006, JTools.org.