org.apache.excalibur.source.impl
Class FileSource.FileSourceOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FileOutputStream
          extended by org.apache.excalibur.source.impl.FileSource.FileSourceOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Enclosing class:
FileSource

private static class FileSource.FileSourceOutputStream
extends java.io.FileOutputStream

A file outputStream that will rename the temp file to the destination file upon close() and discard the temp file upon cancel().


Field Summary
private  boolean m_isClosed
           
private  FileSource m_source
           
private  java.io.File m_tmpFile
           
 
Constructor Summary
FileSource.FileSourceOutputStream(java.io.File tmpFile, FileSource source)
           
 
Method Summary
 boolean canCancel()
           
 void cancel()
           
 void close()
           
 void finalize()
           
 FileSource getSource()
           
 
Methods inherited from class java.io.FileOutputStream
getChannel, getFD, write, write, write
 
Methods inherited from class java.io.OutputStream
flush
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_tmpFile

private java.io.File m_tmpFile

m_isClosed

private boolean m_isClosed

m_source

private FileSource m_source
Constructor Detail

FileSource.FileSourceOutputStream

public FileSource.FileSourceOutputStream(java.io.File tmpFile,
                                         FileSource source)
                                  throws java.io.IOException
Throws:
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.FileOutputStream
Throws:
java.io.IOException

canCancel

public boolean canCancel()

cancel

public void cancel()
            throws java.lang.Exception
Throws:
java.lang.Exception

finalize

public void finalize()
Overrides:
finalize in class java.io.FileOutputStream

getSource

public FileSource getSource()