Package org.eclipse.jetty.util
Class RolloverFileOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.eclipse.jetty.util.RolloverFileOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
@Deprecated(since="2021-05-27") public class RolloverFileOutputStream extends OutputStream
Deprecated.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(String filename)
Deprecated.RolloverFileOutputStream(String filename, boolean append)
Deprecated.RolloverFileOutputStream(String filename, boolean append, int retainDays)
Deprecated.RolloverFileOutputStream(String filename, boolean append, int retainDays, TimeZone zone)
Deprecated.RolloverFileOutputStream(String filename, boolean append, int retainDays, TimeZone zone, String dateFormat, String backupFormat)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.void
flush()
Deprecated.String
getDatedFilename()
Deprecated.String
getFilename()
Deprecated.int
getRetainDays()
Deprecated.static ZonedDateTime
toMidnight(ZonedDateTime now)
Deprecated.Get the "start of day" for the provided DateTime at the zone specified.void
write(byte[] buf)
Deprecated.void
write(byte[] buf, int off, int len)
Deprecated.void
write(int b)
Deprecated.-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
RolloverFileOutputStream
public RolloverFileOutputStream(String filename) throws IOException
Deprecated.- 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:
IOException
- if unable to create output
-
RolloverFileOutputStream
public RolloverFileOutputStream(String filename, boolean append) throws IOException
Deprecated.- 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:
IOException
- if unable to create output
-
RolloverFileOutputStream
public RolloverFileOutputStream(String filename, boolean append, int retainDays) throws IOException
Deprecated.- 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:
IOException
- if unable to create output
-
RolloverFileOutputStream
public RolloverFileOutputStream(String filename, boolean append, int retainDays, TimeZone zone) throws IOException
Deprecated.- 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:
IOException
- if unable to create output
-
RolloverFileOutputStream
public RolloverFileOutputStream(String filename, boolean append, int retainDays, TimeZone zone, String dateFormat, String backupFormat) throws IOException
Deprecated.- 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:
IOException
- if unable to create output
-
-
Method Detail
-
toMidnight
public static ZonedDateTime toMidnight(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 String getFilename()
Deprecated.
-
getDatedFilename
public String getDatedFilename()
Deprecated.
-
getRetainDays
public int getRetainDays()
Deprecated.
-
write
public void write(int b) throws IOException
Deprecated.- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] buf) throws IOException
Deprecated.- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] buf, int off, int len) throws IOException
Deprecated.- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
public void flush() throws IOException
Deprecated.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
Deprecated.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
-