Interface FileCompleteCallback

  • All Known Implementing Classes:
    HttpFileImpl

    public interface FileCompleteCallback
    Invokes on completion of writing the FileChannel content.
    Author:
    Daniel Sagenschneider
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void complete​(java.nio.channels.FileChannel file, boolean isWritten)
      Invoked on completion of writing the FileChannel content.
    • Method Detail

      • complete

        void complete​(java.nio.channels.FileChannel file,
                      boolean isWritten)
               throws java.io.IOException

        Invoked on completion of writing the FileChannel content.

        Note that may also be invoked if content was not written (rather cancelled).

        Typical use is to close the FileChannel once complete.

        WARNING: this is typically invoked on the SocketChannel Thread so should not invoke any long running operations.

        Parameters:
        file - FileChannel from the write.
        isWritten - true indicates whether written, while false indicates cancelled.
        Throws:
        java.io.IOException - If issue in interacting with FileChannel.