Interface ScpTransferEventListener

    • Method Detail

      • startFileEvent

        default void startFileEvent​(Session session,
                                    ScpTransferEventListener.FileOperation op,
                                    java.nio.file.Path file,
                                    long length,
                                    java.util.Set<java.nio.file.attribute.PosixFilePermission> perms)
                             throws java.io.IOException
        Parameters:
        session - The client/server Session through which the transfer is being executed
        op - The ScpTransferEventListener.FileOperation
        file - The local referenced file Path
        length - Size (in bytes) of transferred data
        perms - A Set of PosixFilePermissions to be applied once transfer is complete
        Throws:
        java.io.IOException - If failed to handle the event
      • endFileEvent

        default void endFileEvent​(Session session,
                                  ScpTransferEventListener.FileOperation op,
                                  java.nio.file.Path file,
                                  long length,
                                  java.util.Set<java.nio.file.attribute.PosixFilePermission> perms,
                                  java.lang.Throwable thrown)
                           throws java.io.IOException
        Parameters:
        session - The client/server Session through which the transfer is being executed
        op - The ScpTransferEventListener.FileOperation
        file - The local referenced file Path
        length - Size (in bytes) of transferred data
        perms - A Set of PosixFilePermissions to be applied once transfer is complete
        thrown - The result of the operation attempt - if null then reception was successful
        Throws:
        java.io.IOException - If failed to handle the event
      • handleReceiveCommandAckInfo

        default void handleReceiveCommandAckInfo​(Session session,
                                                 java.lang.String command,
                                                 ScpAckInfo ackInfo)
                                          throws java.io.IOException
        Called after a receive related command has bee acknowledged by the peer
        Parameters:
        session - The client/server Session through which the transfer is being executed
        command - The raw command that was attempted
        ackInfo - The ScpAckInfo received after command execution - including if OK. By default it throws an ScpException if ERROR status code, but the user is free to override this behavior (see ScpClient download fails silently when the remote files does not exist ) - including throwing an exception if OK status...
        Throws:
        java.io.IOException - If bad acknowledgment
      • startFolderEvent

        default void startFolderEvent​(Session session,
                                      ScpTransferEventListener.FileOperation op,
                                      java.nio.file.Path file,
                                      java.util.Set<java.nio.file.attribute.PosixFilePermission> perms)
                               throws java.io.IOException
        Parameters:
        session - The client/server Session through which the transfer is being executed
        op - The ScpTransferEventListener.FileOperation
        file - The local referenced folder Path
        perms - A Set of PosixFilePermissions to be applied once transfer is complete
        Throws:
        java.io.IOException - If failed to handle the event
      • endFolderEvent

        default void endFolderEvent​(Session session,
                                    ScpTransferEventListener.FileOperation op,
                                    java.nio.file.Path file,
                                    java.util.Set<java.nio.file.attribute.PosixFilePermission> perms,
                                    java.lang.Throwable thrown)
                             throws java.io.IOException
        Parameters:
        session - The client/server Session through which the transfer is being executed
        op - The ScpTransferEventListener.FileOperation
        file - The local referenced file Path
        perms - A Set of PosixFilePermissions to be applied once transfer is complete
        thrown - The result of the operation attempt - if null then reception was successful
        Throws:
        java.io.IOException - If failed to handle the event