Class AbstractFileIOChannel

    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
        Logger object for channel and its subclasses
      • fileChannel

        protected final FileChannel fileChannel
        A file channel for NIO access to the file.
    • Constructor Detail

      • AbstractFileIOChannel

        protected AbstractFileIOChannel​(FileIOChannel.ID channelID,
                                        boolean writeEnabled)
                                 throws IOException
        Creates a new channel to the path indicated by the given ID. The channel hands IO requests to the given request queue to be processed.
        Parameters:
        channelID - The id describing the path of the file that the channel accessed.
        writeEnabled - Flag describing whether the channel should be opened in read/write mode, rather than in read-only mode.
        Throws:
        IOException - Thrown, if the channel could no be opened.
    • Method Detail

      • isClosed

        public abstract boolean isClosed()
        Description copied from interface: FileIOChannel
        Checks whether the channel has been closed.
        Specified by:
        isClosed in interface FileIOChannel
        Returns:
        True if the channel has been closed, false otherwise.
      • close

        public abstract void close()
                            throws IOException
        Description copied from interface: FileIOChannel
        Closes the channel. For asynchronous implementations, this method waits until all pending requests are handled. Even if an exception interrupts the closing, the underlying FileChannel is closed.
        Specified by:
        close in interface FileIOChannel
        Throws:
        IOException - Thrown, if an error occurred while waiting for pending requests.
      • deleteChannel

        public void deleteChannel()
        Description copied from interface: FileIOChannel
        Deletes the file underlying this I/O channel.
        Specified by:
        deleteChannel in interface FileIOChannel
      • closeAndDelete

        public void closeAndDelete()
                            throws IOException
        Description copied from interface: FileIOChannel
        Closes the channel and deletes the underlying file. For asynchronous implementations, this method waits until all pending requests are handled.
        Specified by:
        closeAndDelete in interface FileIOChannel
        Throws:
        IOException - Thrown, if an error occurred while waiting for pending requests.