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:
writein classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
isOpen
public boolean isOpen() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-