Class ScpCommandTransferEventListener
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.cli.server.helper.ServerEventListenerHelper
org.apache.sshd.cli.server.helper.ScpCommandTransferEventListener
- All Implemented Interfaces:
EventListener,NamedResource,SshdEventListener,ScpTransferEventListener
public class ScpCommandTransferEventListener
extends ServerEventListenerHelper
implements ScpTransferEventListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.sshd.scp.common.ScpTransferEventListener
ScpTransferEventListener.FileOperation -
Field Summary
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTORFields inherited from interface org.apache.sshd.scp.common.ScpTransferEventListener
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidendFileEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms, Throwable thrown) voidendFolderEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, Set<PosixFilePermission> perms, Throwable thrown) voidhandleFileEventAckInfo(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms, ScpAckInfo ackInfo) Called afterScpTransferEventListener.endFileEvent(Session, FileOperation, Path, long, Set, Throwable)if no exception was thrown and the peer's ACK was successfully readvoidstartFileEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms) voidstartFolderEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, Set<PosixFilePermission> perms) Methods inherited from class org.apache.sshd.cli.server.helper.ServerEventListenerHelper
getNameMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.scp.common.ScpTransferEventListener
handleReceiveCommandAckInfo
-
Constructor Details
-
ScpCommandTransferEventListener
public ScpCommandTransferEventListener(org.slf4j.Logger logger)
-
-
Method Details
-
startFileEvent
public void startFileEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms) throws IOException - Specified by:
startFileEventin interfaceScpTransferEventListener- 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
public void endFileEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms, Throwable thrown) throws IOException - Specified by:
endFileEventin interfaceScpTransferEventListener- 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
-
startFolderEvent
public void startFolderEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, Set<PosixFilePermission> perms) throws IOException - Specified by:
startFolderEventin interfaceScpTransferEventListener- 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
public void endFolderEvent(Session session, ScpTransferEventListener.FileOperation op, Path file, Set<PosixFilePermission> perms, Throwable thrown) throws IOException - Specified by:
endFolderEventin interfaceScpTransferEventListener- 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
-
handleFileEventAckInfo
public void handleFileEventAckInfo(Session session, ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms, ScpAckInfo ackInfo) throws IOException Description copied from interface:ScpTransferEventListenerCalled afterScpTransferEventListener.endFileEvent(Session, FileOperation, Path, long, Set, Throwable)if no exception was thrown and the peer's ACK was successfully read- Specified by:
handleFileEventAckInfoin interfaceScpTransferEventListener- 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
-