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:
Closeable, Flushable

public class RolloverFileOutputStream
extends FilterOutputStream

RolloverFileOutputStream

Author:
Greg Wilkins

Nested Class Summary
private  class RolloverFileOutputStream.Rollover
           
 
Field Summary
(package private) static RolloverFileOutputStream.Rollover __rollover
           
(package private) static ArrayList __rollovers
           
private  boolean _append
           
private  File _file
           
private  SimpleDateFormat _fileBackupFormat
           
private  SimpleDateFormat _fileDateFormat
           
private  String _filename
           
private  WeakReference _ref
           
private  int _retainDays
           
(package private) static String YYYY_MM_DD
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
RolloverFileOutputStream(String filename)
           
RolloverFileOutputStream(String filename, boolean append)
           
RolloverFileOutputStream(String filename, boolean append, int retainDays)
           
 
Method Summary
 void close()
           
 String getDatedFilename()
           
 String getFilename()
           
 int getRetainDays()
           
private  void removeOldFiles()
           
private  void setFile()
           
 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
 

Field Detail

__rollover

static RolloverFileOutputStream.Rollover __rollover

YYYY_MM_DD

static final String YYYY_MM_DD
See Also:
Constant Field Values

__rollovers

static final ArrayList __rollovers

_fileBackupFormat

private SimpleDateFormat _fileBackupFormat

_fileDateFormat

private SimpleDateFormat _fileDateFormat

_filename

private String _filename

_file

private File _file

_append

private boolean _append

_retainDays

private int _retainDays

_ref

private WeakReference _ref
Constructor Detail

RolloverFileOutputStream

public RolloverFileOutputStream(String filename)
                         throws IOException
Throws:
IOException

RolloverFileOutputStream

public RolloverFileOutputStream(String filename,
                                boolean append)
                         throws IOException
Throws:
IOException

RolloverFileOutputStream

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

getFilename

public String getFilename()

getDatedFilename

public String getDatedFilename()

getRetainDays

public int getRetainDays()

setFile

private void setFile()
              throws IOException
Throws:
IOException

removeOldFiles

private void removeOldFiles()

write

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

write

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

close

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