public abstract class AbstractSftpEventListenerAdapter extends org.apache.sshd.common.util.logging.AbstractLoggingBean implements SftpEventListener
SftpEventListener for those who wish to implement only a small number of methods.
By default, all non-overridden methods simply log at TRACE level their invocation parameterslog| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSftpEventListenerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
blocked(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
long length,
int mask,
Throwable thrown)
Called after blocking a file section
|
void |
blocking(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
long length,
int mask)
Called prior to blocking a file section
|
void |
closed(ServerSession session,
String remoteHandle,
Handle localHandle,
Throwable thrown)
Specified file / directory has been closed
|
void |
closing(ServerSession session,
String remoteHandle,
Handle localHandle)
Specified file / directory about to be closed
|
void |
created(ServerSession session,
Path path,
Map<String,?> attrs,
Throwable thrown)
Called after creating a directory
|
void |
creating(ServerSession session,
Path path,
Map<String,?> attrs)
Called prior to creating a directory
|
void |
destroying(ServerSession session)
Called when subsystem is destroyed since it was closed
|
void |
exiting(ServerSession session,
Handle handle)
Called when subsystem is exiting due to being destroyed
|
void |
initialized(ServerSession session,
int version)
Called when the SFTP protocol has been initialized
|
void |
linked(ServerSession session,
Path source,
Path target,
boolean symLink,
Throwable thrown)
Called after creating a link
|
void |
linking(ServerSession session,
Path source,
Path target,
boolean symLink)
Called prior to creating a link
|
void |
modifiedAttributes(ServerSession session,
Path path,
Map<String,?> attrs,
Throwable thrown)
Called after modifying the attributes of a file / directory
|
void |
modifyingAttributes(ServerSession session,
Path path,
Map<String,?> attrs)
Called prior to modifying the attributes of a file / directory
|
void |
moved(ServerSession session,
Path srcPath,
Path dstPath,
Collection<CopyOption> opts,
Throwable thrown)
Called after renaming a file / directory
|
void |
moving(ServerSession session,
Path srcPath,
Path dstPath,
Collection<CopyOption> opts)
Called prior to renaming a file / directory
|
void |
open(ServerSession session,
String remoteHandle,
Handle localHandle)
Specified file / directory has been opened
|
void |
openFailed(ServerSession session,
String remotePath,
Path localPath,
boolean isDirectory,
Throwable thrown)
Specified file / directory could not be opened - Note: this call may occur without
SftpEventListener.opening(ServerSession, String, Handle) ever having been called |
void |
opening(ServerSession session,
String remoteHandle,
Handle localHandle)
Specified file / directory is being opened
|
void |
read(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
byte[] data,
int dataOffset,
int dataLen,
int readLen,
Throwable thrown)
Result of reading from a file
|
void |
readEntries(ServerSession session,
String remoteHandle,
DirectoryHandle localHandle,
Map<String,Path> entries)
Result of reading entries from a directory - Note: it may be a partial result if the directory
contains more entries than can be accommodated in the response
|
void |
reading(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
byte[] data,
int dataOffset,
int dataLen)
Preparing to read from a file
|
void |
readingEntries(ServerSession session,
String remoteHandle,
DirectoryHandle localHandle)
About to read entries from a directory - Note: might not be the 1st time it is called for the directory in
case several iterations are required in order to go through all the entries in the directory
|
void |
receivedExtension(ServerSession session,
String extension,
int id)
Called when a SFTP extension request
SftpConstants.SSH_FXP_EXTENDED has been received before it is
processed. |
void |
removed(ServerSession session,
Path path,
boolean isDirectory,
Throwable thrown)
Called after a file has been removed
|
void |
removing(ServerSession session,
Path path,
boolean isDirectory)
Called prior to removing a file
|
void |
unblocked(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
long length,
Throwable thrown)
Called prior to un-blocking a file section
|
void |
unblocking(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
long length)
Called prior to un-blocking a file section
|
void |
writing(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
byte[] data,
int dataOffset,
int dataLen)
Preparing to write to file
|
void |
written(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
byte[] data,
int dataOffset,
int dataLen,
Throwable thrown)
Finished to writing to file
|
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreceived, validateListenervalidateListenerpublic void receivedExtension(ServerSession session, String extension, int id) throws IOException
SftpEventListenerSftpConstants.SSH_FXP_EXTENDED has been received before it is
processed.receivedExtension in interface SftpEventListenersession - The ServerSession through which the request was receivedextension - The extension request received; one of the SSH_EXT_* constants from
SftpConstantsid - The id received with the requestIOException - If the request shall generate an error response.public void initialized(ServerSession session, int version) throws IOException
SftpEventListenerinitialized in interface SftpEventListenersession - The ServerSession through which the request was handledversion - The negotiated SFTP versionIOException - If failed to handle the callpublic void destroying(ServerSession session) throws IOException
SftpEventListenerdestroying in interface SftpEventListenersession - The associated ServerSessionIOException - If failed to handle the callpublic void opening(ServerSession session, String remoteHandle, Handle localHandle) throws IOException
SftpEventListeneropening in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the file / directorylocalHandle - The associated file / directory HandleIOException - If failed to handle the callpublic void openFailed(ServerSession session, String remotePath, Path localPath, boolean isDirectory, Throwable thrown) throws IOException
SftpEventListenerSftpEventListener.opening(ServerSession, String, Handle) ever having been calledopenFailed in interface SftpEventListenersession - The ServerSession through which the request was handledremotePath - The path that was specified in the commandlocalPath - The matching resolved local pathisDirectory - Whether this was a folder or a filethrown - Non-null reason for the failureIOException - If failed to handle the callpublic void open(ServerSession session, String remoteHandle, Handle localHandle) throws IOException
SftpEventListeneropen in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the file / directorylocalHandle - The associated file / directory HandleIOException - If failed to handle the callpublic void readingEntries(ServerSession session, String remoteHandle, DirectoryHandle localHandle) throws IOException
SftpEventListenerreadingEntries in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the directorylocalHandle - The associated DirectoryHandleIOException - If failed to handle the callreadEntriespublic void readEntries(ServerSession session, String remoteHandle, DirectoryHandle localHandle, Map<String,Path> entries) throws IOException
SftpEventListenerreadEntries in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the directorylocalHandle - The associated DirectoryHandleentries - A Map of the listed entries - key = short name, value = Path of the
sub-entryIOException - If failed to handle the callpublic void reading(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, byte[] data, int dataOffset, int dataLen) throws IOException
SftpEventListenerreading in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the filelocalHandle - The associated FileHandleoffset - Offset in file from which to readdata - Buffer holding the read datadataOffset - Offset of read data in bufferdataLen - Requested read lengthIOException - If failed to handle the callpublic void read(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, byte[] data, int dataOffset, int dataLen, int readLen, Throwable thrown) throws IOException
SftpEventListenerread in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the filelocalHandle - The associated FileHandleoffset - Offset in file from which to readdata - Buffer holding the read datadataOffset - Offset of read data in bufferdataLen - Requested read lengthreadLen - Actual read length - negative if thrown exception providedthrown - Non-null if read failed due to this exceptionIOException - If failed to handle the callpublic void writing(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, byte[] data, int dataOffset, int dataLen) throws IOException
SftpEventListenerwriting in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the filelocalHandle - The associated FileHandleoffset - Offset in file to which to writedata - Buffer holding the written datadataOffset - Offset of write data in bufferdataLen - Requested write lengthIOException - If failed to handle the callpublic void written(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, byte[] data, int dataOffset, int dataLen, Throwable thrown) throws IOException
SftpEventListenerwritten in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the filelocalHandle - The associated FileHandleoffset - Offset in file to which to writedata - Buffer holding the written datadataOffset - Offset of write data in bufferdataLen - Requested write lengththrown - The reason for failing to write - null if successfulIOException - If failed to handle the callpublic void blocking(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, long length, int mask) throws IOException
SftpEventListenerblocking in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the filelocalHandle - The associated FileHandleoffset - Offset in file for lockinglength - Section size for lockingmask - Lock mask flags - see SSH_FXP_BLOCK messageIOException - If failed to handle the callSftpEventListener.blocked(ServerSession, String, FileHandle, long, long, int, Throwable)public void blocked(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, long length, int mask, Throwable thrown) throws IOException
SftpEventListenerblocked in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the filelocalHandle - The associated FileHandleoffset - Offset in file for lockinglength - Section size for lockingmask - Lock mask flags - see SSH_FXP_BLOCK messagethrown - If not-null then the reason for the failure to executeIOException - If failed to handle the callpublic void unblocking(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, long length) throws IOException
SftpEventListenerunblocking in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the filelocalHandle - The associated FileHandleoffset - Offset in file for un-lockinglength - Section size for un-lockingIOException - If failed to handle the callpublic void unblocked(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, long length, Throwable thrown) throws IOException
SftpEventListenerunblocked in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the filelocalHandle - The associated FileHandleoffset - Offset in file for un-lockinglength - Section size for un-lockingthrown - If not-null then the reason for the failure to executeIOException - If failed to handle the callpublic void closing(ServerSession session, String remoteHandle, Handle localHandle) throws IOException
SftpEventListenerclosing in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the file / directorylocalHandle - The associated file / directory HandleIOException - If failed to handle the callpublic void closed(ServerSession session, String remoteHandle, Handle localHandle, Throwable thrown) throws IOException
SftpEventListenerclosed in interface SftpEventListenersession - The ServerSession through which the request was handledremoteHandle - The (opaque) assigned handle for the file / directorylocalHandle - The associated file / directory Handlethrown - If not-null then the reason for the failure to executeIOException - If failed to handle the callpublic void creating(ServerSession session, Path path, Map<String,?> attrs) throws IOException
SftpEventListenercreating in interface SftpEventListenersession - The ServerSession through which the request was handledpath - Directory Path to be createdattrs - Requested associated attributes to setIOException - If failed to handle the callSftpEventListener.created(ServerSession, Path, Map, Throwable)public void created(ServerSession session, Path path, Map<String,?> attrs, Throwable thrown) throws IOException
SftpEventListenercreated in interface SftpEventListenersession - The ServerSession through which the request was handledpath - Directory Path to be createdattrs - Requested associated attributes to setthrown - If not-null then the reason for the failure to executeIOException - If failed to handle the callpublic void moving(ServerSession session, Path srcPath, Path dstPath, Collection<CopyOption> opts) throws IOException
SftpEventListenermoving in interface SftpEventListenersession - The ServerSession through which the request was handledsrcPath - The source PathdstPath - The target Pathopts - The resolved renaming optionsIOException - If failed to handle the callSftpEventListener.moved(ServerSession, Path, Path, Collection, Throwable)public void moved(ServerSession session, Path srcPath, Path dstPath, Collection<CopyOption> opts, Throwable thrown) throws IOException
SftpEventListenermoved in interface SftpEventListenersession - The ServerSession through which the request was handledsrcPath - The source PathdstPath - The target Pathopts - The resolved renaming optionsthrown - If not-null then the reason for the failure to executeIOException - If failed to handle the callpublic void removing(ServerSession session, Path path, boolean isDirectory) throws IOException
SftpEventListenerremoving in interface SftpEventListenersession - The ServerSession through which the request was handledpath - The Path about to be removedisDirectory - Whether this is a folder or a fileIOException - If failed to handle the callSftpEventListener.removed(ServerSession, Path, boolean, Throwable)public void removed(ServerSession session, Path path, boolean isDirectory, Throwable thrown) throws IOException
SftpEventListenerremoved in interface SftpEventListenersession - The ServerSession through which the request was handledpath - The Path to be removedisDirectory - Whether this was a folder or a filethrown - If not-null then the reason for the failure to executeIOException - If failed to handle the callpublic void linking(ServerSession session, Path source, Path target, boolean symLink) throws IOException
SftpEventListenerlinking in interface SftpEventListenersession - The ServerSession through which the request was handledsource - The source Pathtarget - The target PathsymLink - true = symbolic linkIOException - If failed to handle the callSftpEventListener.linked(ServerSession, Path, Path, boolean, Throwable)public void linked(ServerSession session, Path source, Path target, boolean symLink, Throwable thrown) throws IOException
SftpEventListenerlinked in interface SftpEventListenersession - The ServerSession through which the request was handledsource - The source Pathtarget - The target PathsymLink - true = symbolic linkthrown - If not-null then the reason for the failure to executeIOException - If failed to handle the callpublic void modifyingAttributes(ServerSession session, Path path, Map<String,?> attrs) throws IOException
SftpEventListenermodifyingAttributes in interface SftpEventListenersession - The ServerSession through which the request was handledpath - The file / directory Path to be modifiedattrs - The attributes Map - names and values depend on the O/S, view, type, etc...IOException - If failed to handle the callSftpEventListener.modifiedAttributes(ServerSession, Path, Map, Throwable)public void modifiedAttributes(ServerSession session, Path path, Map<String,?> attrs, Throwable thrown) throws IOException
SftpEventListenermodifiedAttributes in interface SftpEventListenersession - The ServerSession through which the request was handledpath - The file / directory Path to be modifiedattrs - The attributes Map - names and values depend on the O/S, view, type, etc...thrown - If not-null then the reason for the failure to executeIOException - If failed to handle the callpublic void exiting(ServerSession session, Handle handle) throws IOException
SftpEventListenerexiting in interface SftpEventListenersession - The associated ServerSessionhandle - The file / directory Handle being closed due to the exitIOException - If failed to handle the callCopyright © 2018–2024 The Apache Software Foundation. All rights reserved.