Class DefaultFileChannel

  • All Implemented Interfaces:
    BookieFileChannel

    public class DefaultFileChannel
    extends java.lang.Object
    implements BookieFileChannel
    Default FileChannel for bookie to read and write.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close file channel and release all resources.
      boolean fileExists​(java.io.File file)
      Check the given file if exists.
      java.io.FileDescriptor getFD()
      Get the file descriptor of the opened file.
      java.nio.channels.FileChannel getFileChannel()
      An interface for get the FileChannel from the provider.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultFileChannel

        DefaultFileChannel​(java.io.File file,
                           ServerConfiguration serverConfiguration)
                    throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getFileChannel

        public java.nio.channels.FileChannel getFileChannel()
                                                     throws java.io.FileNotFoundException
        Description copied from interface: BookieFileChannel
        An interface for get the FileChannel from the provider.
        Specified by:
        getFileChannel in interface BookieFileChannel
        Returns:
        Throws:
        java.io.FileNotFoundException
      • getFD

        public java.io.FileDescriptor getFD()
                                     throws java.io.IOException
        Description copied from interface: BookieFileChannel
        Get the file descriptor of the opened file.
        Specified by:
        getFD in interface BookieFileChannel
        Returns:
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: BookieFileChannel
        Close file channel and release all resources.
        Specified by:
        close in interface BookieFileChannel
        Throws:
        java.io.IOException