Package hudson.util
Class FileChannelWriter
java.lang.Object
java.io.Writer
hudson.util.FileChannelWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
,Channel
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class FileChannelWriter
extends Writer
implements Channel
This class has been created to help make
AtomicFileWriter
hopefully more reliable in some corner cases.
We created this wrapper to be able to access FileChannel.force(boolean)
which seems to be one of the rare
ways to actually have a guarantee that data be flushed to the physical device (only guaranteed for local, not for
remote obviously though).
The goal using this is to reduce as much as we can the likeliness to see zero-length files be created in place of the original ones.
- See Also:
-
Method Details
-
write
- Specified by:
write
in classWriter
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
isOpen
public boolean isOpen() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-