public interface SftpEventListener extends EventListener
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 |
close(ServerSession session,
String remoteHandle,
Handle localHandle)
Specified file / directory has been 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 |
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 |
read(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 |
read(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
byte[] data,
int dataOffset,
int dataLen,
int readLen)
Result of reading from a file
|
void |
removed(ServerSession session,
Path path,
Throwable thrown)
Called after a file / directory has been removed
|
void |
removing(ServerSession session,
Path path)
Called prior to removing a file / directory
|
void |
unblocked(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
long length,
Boolean result,
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 |
write(ServerSession session,
String remoteHandle,
FileHandle localHandle,
long offset,
byte[] data,
int dataOffset,
int dataLen)
Result of writing to a file
|
void initialized(ServerSession session, int version)
session
- The ServerSession
through which the request was handledversion
- The negotiated SFTP versionvoid destroying(ServerSession session)
session
- The associated ServerSession
void open(ServerSession session, String remoteHandle, Handle localHandle)
session
- The ServerSession
through which the request was handledremoteHandle
- The (opaque) assigned handle for the file / directorylocalHandle
- The associated file / directory Handle
void read(ServerSession session, String remoteHandle, DirectoryHandle localHandle, Map<String,Path> entries)
session
- The ServerSession
through which the request was handledremoteHandle
- The (opaque) assigned handle for the directorylocalHandle
- The associated DirectoryHandle
entries
- A Map
of the listed entries - key = short name,
value = Path
of the sub-entryvoid read(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, byte[] data, int dataOffset, int dataLen, int readLen)
session
- The ServerSession
through which the request was handledremoteHandle
- The (opaque) assigned handle for the filelocalHandle
- The associated FileHandle
offset
- Offset in file from which to readdata
- Buffer holding the read datadataOffset
- Offset of read data in bufferdataLen
- Requested read lengthreadLen
- Actual read lengthvoid write(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, byte[] data, int dataOffset, int dataLen)
session
- The ServerSession
through which the request was handledremoteHandle
- The (opaque) assigned handle for the filelocalHandle
- The associated FileHandle
offset
- Offset in file to which to writedata
- Buffer holding the written datadataOffset
- Offset of write data in bufferdataLen
- Requested write lengthvoid blocking(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, long length, int mask)
session
- The ServerSession
through which the request was handledremoteHandle
- The (opaque) assigned handle for the filelocalHandle
- The associated FileHandle
offset
- Offset in file for lockinglength
- Section size for lockingmask
- Lock mask flags - see SSH_FXP_BLOCK
messageblocked(ServerSession, String, FileHandle, long, long, int, Throwable)
void blocked(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, long length, int mask, Throwable thrown)
session
- The ServerSession
through which the request was handledremoteHandle
- The (opaque) assigned handle for the filelocalHandle
- The associated FileHandle
offset
- 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 executevoid unblocking(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, long length)
session
- The ServerSession
through which the request was handledremoteHandle
- The (opaque) assigned handle for the filelocalHandle
- The associated FileHandle
offset
- Offset in file for un-lockinglength
- Section size for un-lockingvoid unblocked(ServerSession session, String remoteHandle, FileHandle localHandle, long offset, long length, Boolean result, Throwable thrown)
session
- The ServerSession
through which the request was handledremoteHandle
- The (opaque) assigned handle for the filelocalHandle
- The associated FileHandle
offset
- Offset in file for un-lockinglength
- Section size for un-lockingresult
- If successful (i.e., thrown is null
, then whether
section was un-blockedthrown
- If not-null
then the reason for the failure to executevoid close(ServerSession session, String remoteHandle, Handle localHandle)
session
- The ServerSession
through which the request was handledremoteHandle
- The (opaque) assigned handle for the file / directorylocalHandle
- The associated file / directory Handle
void creating(ServerSession session, Path path, Map<String,?> attrs)
session
- The ServerSession
through which the request was handledpath
- Directory Path
to be createdattrs
- Requested associated attributes to setcreated(ServerSession, Path, Map, Throwable)
void created(ServerSession session, Path path, Map<String,?> attrs, Throwable thrown)
session
- 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 executevoid moving(ServerSession session, Path srcPath, Path dstPath, Collection<CopyOption> opts)
session
- The ServerSession
through which the request was handledsrcPath
- The source Path
dstPath
- The target Path
opts
- The resolved renaming optionsmoved(ServerSession, Path, Path, Collection, Throwable)
void moved(ServerSession session, Path srcPath, Path dstPath, Collection<CopyOption> opts, Throwable thrown)
session
- The ServerSession
through which the request was handledsrcPath
- The source Path
dstPath
- The target Path
opts
- The resolved renaming optionsthrown
- If not-null
then the reason for the failure to executevoid removing(ServerSession session, Path path)
session
- The ServerSession
through which the request was handledpath
- The Path
about to be removedremoved(ServerSession, Path, Throwable)
void removed(ServerSession session, Path path, Throwable thrown)
session
- The ServerSession
through which the request was handledpath
- The Path
to be removedthrown
- If not-null
then the reason for the failure to executevoid linking(ServerSession session, Path source, Path target, boolean symLink)
session
- The ServerSession
through which the request was handledsource
- The source Path
target
- The target Path
symLink
- true
= symbolic linklinked(ServerSession, Path, Path, boolean, Throwable)
void linked(ServerSession session, Path source, Path target, boolean symLink, Throwable thrown)
session
- The ServerSession
through which the request was handledsource
- The source Path
target
- The target Path
symLink
- true
= symbolic linkthrown
- If not-null
then the reason for the failure to executevoid modifyingAttributes(ServerSession session, Path path, Map<String,?> attrs)
session
- 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...modifiedAttributes(ServerSession, Path, Map, Throwable)
void modifiedAttributes(ServerSession session, Path path, Map<String,?> attrs, Throwable thrown)
session
- 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 executeCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.