Class NioFile

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public final class NioFile
    extends Object
    implements Closeable
    File wrapper that protects against concurrent file closing events due to e.g. thread interrupts. In case the file channel that is used by this class is closed due to such an event, it will try to reopen the channel. The thread that causes the ClosedByInterruptException is not protected, assuming the interrupt is intended to end the thread's operation.
    Author:
    Arjohn Kampman