public class RolloverFileOutputStream extends FilterOutputStream
out| Constructor and Description |
|---|
RolloverFileOutputStream(String filename) |
RolloverFileOutputStream(String filename,
boolean append) |
RolloverFileOutputStream(String filename,
boolean append,
int retainDays) |
RolloverFileOutputStream(String filename,
boolean append,
int retainDays,
TimeZone zone) |
RolloverFileOutputStream(String filename,
boolean append,
int retainDays,
TimeZone zone,
String dateFormat,
String backupFormat) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
getDatedFilename() |
String |
getFilename() |
int |
getRetainDays() |
void |
write(byte[] buf) |
void |
write(byte[] buf,
int off,
int len) |
flush, writepublic RolloverFileOutputStream(String filename) throws IOException
filename - The filename must include the string "yyyy_mm_dd",
which is replaced with the actual date when creating and rolling over the file.IOExceptionpublic RolloverFileOutputStream(String filename, boolean append) throws IOException
filename - The filename must include the string "yyyy_mm_dd",
which is replaced with the actual date when creating and rolling over the file.append - If true, existing files will be appended to.IOExceptionpublic RolloverFileOutputStream(String filename, boolean append, int retainDays) throws IOException
filename - The filename must include the string "yyyy_mm_dd",
which is replaced with the actual date when creating and rolling over the file.append - If true, existing files will be appended to.retainDays - The number of days to retain files before deleting them. 0 to retain forever.IOExceptionpublic RolloverFileOutputStream(String filename, boolean append, int retainDays, TimeZone zone) throws IOException
filename - The filename must include the string "yyyy_mm_dd",
which is replaced with the actual date when creating and rolling over the file.append - If true, existing files will be appended to.retainDays - The number of days to retain files before deleting them. 0 to retain forever.IOExceptionpublic RolloverFileOutputStream(String filename, boolean append, int retainDays, TimeZone zone, String dateFormat, String backupFormat) throws IOException
filename - The filename must include the string "yyyy_mm_dd",
which is replaced with the actual date when creating and rolling over the file.append - If true, existing files will be appended to.retainDays - The number of days to retain files before deleting them. 0 to retain forever.dateFormat - The format for the date file substitution. The default is "yyyy_MM_dd".backupFormat - The format for the file extension of backup files. The default is "HHmmssSSS".IOExceptionpublic String getFilename()
public String getDatedFilename()
public int getRetainDays()
public void write(byte[] buf)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void write(byte[] buf,
int off,
int len)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterOutputStreamIOExceptionCopyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.