org.mortbay.util
Class RolloverFileOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.mortbay.util.RolloverFileOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class RolloverFileOutputStream
extends java.io.FilterOutputStream

A File OutputStream that rolls overs. If the passed filename contains the string "yyyy_mm_dd" on daily intervals.

Version:
$Id: RolloverFileOutputStream.java,v 1.14 2005/08/13 00:01:28 gregwilkins Exp $
Author:
Greg Wilkins (gregw)

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
RolloverFileOutputStream(java.lang.String filename)
           
RolloverFileOutputStream(java.lang.String filename, boolean append)
           
RolloverFileOutputStream(java.lang.String filename, boolean append, int retainDays)
           
 
Method Summary
 void close()
           
 java.lang.String getDatedFilename()
           
 java.lang.String getFilename()
           
 int getRetainDays()
           
 void write(byte[] buf)
           
 void write(byte[] buf, int off, int len)
           
 
Methods inherited from class java.io.FilterOutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RolloverFileOutputStream

public RolloverFileOutputStream(java.lang.String filename)
                         throws java.io.IOException
Throws:
java.io.IOException

RolloverFileOutputStream

public RolloverFileOutputStream(java.lang.String filename,
                                boolean append)
                         throws java.io.IOException
Throws:
java.io.IOException

RolloverFileOutputStream

public RolloverFileOutputStream(java.lang.String filename,
                                boolean append,
                                int retainDays)
                         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getFilename

public java.lang.String getFilename()

getDatedFilename

public java.lang.String getDatedFilename()

getRetainDays

public int getRetainDays()

write

public void write(byte[] buf)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(byte[] buf,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

close

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


Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.