Package org.apache.sshd.scp.common
Interface ScpTransferEventListener
- All Superinterfaces:
EventListener,SshdEventListener
- All Known Implementing Classes:
AbstractScpTransferEventListenerAdapter
Can be registered in order to receive events about SCP transfers
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ScpTransferEventListenerAn "empty" implementation to be used instead ofnulls -
Method Summary
Modifier and TypeMethodDescriptiondefault voidendFileEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms, Throwable thrown) default voidendFolderEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, Set<PosixFilePermission> perms, Throwable thrown) default voidhandleFileEventAckInfo(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms, ScpAckInfo ackInfo) Called afterendFileEvent(Session, FileOperation, Path, long, Set, Throwable)if no exception was thrown and the peer's ACK was successfully readdefault voidhandleReceiveCommandAckInfo(Session session, String command, ScpAckInfo ackInfo) Called after a receive related command has bee acknowledged by the peerdefault voidstartFileEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms) default voidstartFolderEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, Set<PosixFilePermission> perms) static <L extends ScpTransferEventListener>
LvalidateListener(L listener)
-
Field Details
-
EMPTY
An "empty" implementation to be used instead ofnulls
-
-
Method Details
-
startFileEvent
default void startFileEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms) throws IOException - Parameters:
session- The client/serverSessionthrough which the transfer is being executedop- TheScpTransferEventListener.FileOperationfile- The local referenced filePathlength- Size (in bytes) of transferred dataperms- ASetofPosixFilePermissions to be applied once transfer is complete- Throws:
IOException- If failed to handle the event
-
endFileEvent
default void endFileEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms, Throwable thrown) throws IOException - Parameters:
session- The client/serverSessionthrough which the transfer is being executedop- TheScpTransferEventListener.FileOperationfile- The local referenced filePathlength- Size (in bytes) of transferred dataperms- ASetofPosixFilePermissions to be applied once transfer is completethrown- The result of the operation attempt - ifnullthen reception was successful- Throws:
IOException- If failed to handle the event
-
handleFileEventAckInfo
default void handleFileEventAckInfo(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms, ScpAckInfo ackInfo) throws IOException Called afterendFileEvent(Session, FileOperation, Path, long, Set, Throwable)if no exception was thrown and the peer's ACK was successfully read- Parameters:
session- The client/serverSessionthrough which the transfer is being executedop- TheScpTransferEventListener.FileOperationfile- The local referenced filePathlength- Size (in bytes) of transferred dataperms- ASetofPosixFilePermissions to be applied once transfer is completeackInfo- TheScpAckInforeceived after a file transfer - before validating it- Throws:
IOException- If failed to handle the event
-
handleReceiveCommandAckInfo
default void handleReceiveCommandAckInfo(Session session, String command, ScpAckInfo ackInfo) throws IOException Called after a receive related command has bee acknowledged by the peer- Parameters:
session- The client/serverSessionthrough which the transfer is being executedcommand- The raw command that was attemptedackInfo- TheScpAckInforeceived after command execution - including ifOK. By default it throws anScpExceptionifERRORstatus 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:
IOException- If bad acknowledgment
-
startFolderEvent
default void startFolderEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, Set<PosixFilePermission> perms) throws IOException - Parameters:
session- The client/serverSessionthrough which the transfer is being executedop- TheScpTransferEventListener.FileOperationfile- The local referenced folderPathperms- ASetofPosixFilePermissions to be applied once transfer is complete- Throws:
IOException- If failed to handle the event
-
endFolderEvent
default void endFolderEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, Set<PosixFilePermission> perms, Throwable thrown) throws IOException - Parameters:
session- The client/serverSessionthrough which the transfer is being executedop- TheScpTransferEventListener.FileOperationfile- The local referenced filePathperms- ASetofPosixFilePermissions to be applied once transfer is completethrown- The result of the operation attempt - ifnullthen reception was successful- Throws:
IOException- If failed to handle the event
-
validateListener
-