Package hudson.plugins.timestamper.io
Class TimestampsWriter
- java.lang.Object
-
- hudson.plugins.timestamper.io.TimestampsWriter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class TimestampsWriter extends Object implements Closeable
Write the time-stamps for a build to disk.- Author:
- Steven G. Brown
-
-
Constructor Summary
Constructors Constructor Description TimestampsWriter(Run<?,?> build)
Create a time-stamps writer for the given build.TimestampsWriter(Run<?,?> build, Optional<MessageDigest> digest)
Create a time-stamps writer for the given build.TimestampsWriter(Path timestampsFile, long buildStartTime, Optional<MessageDigest> digest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
write(long currentTimeMillis, int times)
Write a time-stamp for a line of the console log.void
writeDigest()
Write a time-stamps digest file for the build.
-
-
-
Constructor Detail
-
TimestampsWriter
public TimestampsWriter(Run<?,?> build) throws IOException
Create a time-stamps writer for the given build.- Throws:
IOException
-
TimestampsWriter
public TimestampsWriter(Run<?,?> build, Optional<MessageDigest> digest) throws IOException
Create a time-stamps writer for the given build.- Throws:
IOException
-
TimestampsWriter
public TimestampsWriter(Path timestampsFile, long buildStartTime, Optional<MessageDigest> digest) throws IOException
- Throws:
IOException
-
-
Method Detail
-
write
public void write(long currentTimeMillis, int times) throws IOException
Write a time-stamp for a line of the console log.- Parameters:
currentTimeMillis
-System.currentTimeMillis()
times
- the number of times to write the time-stamp- Throws:
IOException
-
writeDigest
public void writeDigest() throws IOException
Write a time-stamps digest file for the build.- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-