Package org.eclipse.jetty.util
Class RolloverFileOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.eclipse.jetty.util.RolloverFileOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
@Deprecated(since="2021-05-27") public class RolloverFileOutputStream extends java.io.OutputStreamDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.RolloverFileOutputStream.This output stream puts content in a file that is rolled over every 24 hours. The filename must include the string "yyyy_mm_dd", which is replaced with the actual date when creating and rolling over the file.
Old files are retained for a number of days before being deleted.
-
-
Constructor Summary
Constructors Constructor Description RolloverFileOutputStream(java.lang.String filename)Deprecated.RolloverFileOutputStream(java.lang.String filename, boolean append)Deprecated.RolloverFileOutputStream(java.lang.String filename, boolean append, int retainDays)Deprecated.RolloverFileOutputStream(java.lang.String filename, boolean append, int retainDays, java.util.TimeZone zone)Deprecated.RolloverFileOutputStream(java.lang.String filename, boolean append, int retainDays, java.util.TimeZone zone, java.lang.String dateFormat, java.lang.String backupFormat)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.voidflush()Deprecated.java.lang.StringgetDatedFilename()Deprecated.java.lang.StringgetFilename()Deprecated.intgetRetainDays()Deprecated.static java.time.ZonedDateTimetoMidnight(java.time.ZonedDateTime now)Deprecated.Get the "start of day" for the provided DateTime at the zone specified.voidwrite(byte[] buf)Deprecated.voidwrite(byte[] buf, int off, int len)Deprecated.voidwrite(int b)Deprecated.
-
-
-
Constructor Detail
-
RolloverFileOutputStream
public RolloverFileOutputStream(java.lang.String filename) throws java.io.IOExceptionDeprecated.- Parameters:
filename- The filename must include the string "yyyy_mm_dd", which is replaced with the actual date when creating and rolling over the file.- Throws:
java.io.IOException- if unable to create output
-
RolloverFileOutputStream
public RolloverFileOutputStream(java.lang.String filename, boolean append) throws java.io.IOExceptionDeprecated.- Parameters:
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.- Throws:
java.io.IOException- if unable to create output
-
RolloverFileOutputStream
public RolloverFileOutputStream(java.lang.String filename, boolean append, int retainDays) throws java.io.IOExceptionDeprecated.- Parameters:
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.- Throws:
java.io.IOException- if unable to create output
-
RolloverFileOutputStream
public RolloverFileOutputStream(java.lang.String filename, boolean append, int retainDays, java.util.TimeZone zone) throws java.io.IOExceptionDeprecated.- Parameters:
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.zone- the timezone for the output- Throws:
java.io.IOException- if unable to create output
-
RolloverFileOutputStream
public RolloverFileOutputStream(java.lang.String filename, boolean append, int retainDays, java.util.TimeZone zone, java.lang.String dateFormat, java.lang.String backupFormat) throws java.io.IOExceptionDeprecated.- Parameters:
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.zone- the timezone for the outputdateFormat- The format for the date file substitution. The default is "yyyy_MM_dd". If set to the empty string, the file is rolledover to the same filename, with the current file being renamed to the backup filename.backupFormat- The format for the file extension of backup files. The default is "HHmmssSSS".- Throws:
java.io.IOException- if unable to create output
-
-
Method Detail
-
toMidnight
public static java.time.ZonedDateTime toMidnight(java.time.ZonedDateTime now)
Deprecated.Get the "start of day" for the provided DateTime at the zone specified.- Parameters:
now- the date time to calculate from- Returns:
- start of the day of the date provided
-
getFilename
public java.lang.String getFilename()
Deprecated.
-
getDatedFilename
public java.lang.String getDatedFilename()
Deprecated.
-
getRetainDays
public int getRetainDays()
Deprecated.
-
write
public void write(int b) throws java.io.IOExceptionDeprecated.- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] buf) throws java.io.IOExceptionDeprecated.- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] buf, int off, int len) throws java.io.IOExceptionDeprecated.- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOExceptionDeprecated.- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionDeprecated.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
-