public interface SftpFileSystemAccessor
| Modifier and Type | Field and Description |
|---|---|
static SftpFileSystemAccessor |
DEFAULT |
static boolean |
DEFAULT_AUTO_SYNC_FILE_ON_CLOSE
Default value for "sftp-auto-fsync-on-close" if none set
|
static List<String> |
DEFAULT_UNIX_VIEW |
static NavigableMap<String,org.apache.sshd.common.util.io.FileInfoExtractor<?>> |
FILEATTRS_RESOLVERS
A case insensitive
NavigableMap of FileInfoExtractors to
be used to complete attributes that are deemed important enough to warrant an
extra effort if not accessible via the file system attributes views |
static String |
PROP_AUTO_SYNC_FILE_ON_CLOSE
Whether to invoke
FileChannel.force(boolean) on files open for write when closing |
| Modifier and Type | Method and Description |
|---|---|
default void |
closeDirectory(ServerSession session,
SftpEventListenerManager subsystem,
DirectoryHandle dirHandle,
Path dir,
String handle,
DirectoryStream<Path> ds)
Called when a directory stream is no longer required
|
default void |
closeFile(ServerSession session,
SftpEventListenerManager subsystem,
FileHandle fileHandle,
Path file,
String handle,
Channel channel,
Set<? extends OpenOption> options)
Called to inform the accessor that it should close the file
|
default DirectoryStream<Path> |
openDirectory(ServerSession session,
SftpEventListenerManager subsystem,
DirectoryHandle dirHandle,
Path dir,
String handle)
Called when a new directory stream is requested
|
default SeekableByteChannel |
openFile(ServerSession session,
SftpEventListenerManager subsystem,
FileHandle fileHandle,
Path file,
String handle,
Set<? extends OpenOption> options,
FileAttribute<?>... attrs)
Called whenever a new file is opened
|
default void |
syncFileData(ServerSession session,
SftpEventListenerManager subsystem,
FileHandle fileHandle,
Path file,
String handle,
Channel channel)
Called when file meta-data re-synchronization is required
|
default FileLock |
tryLock(ServerSession session,
SftpEventListenerManager subsystem,
FileHandle fileHandle,
Path file,
String handle,
Channel channel,
long position,
long size,
boolean shared)
Called when locking a section of a file is requested
|
static final NavigableMap<String,org.apache.sshd.common.util.io.FileInfoExtractor<?>> FILEATTRS_RESOLVERS
NavigableMap of FileInfoExtractors to
be used to complete attributes that are deemed important enough to warrant an
extra effort if not accessible via the file system attributes viewsstatic final String PROP_AUTO_SYNC_FILE_ON_CLOSE
FileChannel.force(boolean) on files open for write when closingstatic final boolean DEFAULT_AUTO_SYNC_FILE_ON_CLOSE
static final SftpFileSystemAccessor DEFAULT
default SeekableByteChannel openFile(ServerSession session, SftpEventListenerManager subsystem, FileHandle fileHandle, Path file, String handle, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
session - The ServerSession through which the request was receivedsubsystem - The SFTP subsystem instance that manages the sessionfileHandle - The FileHandle representing the created channel - may be
null if not invoked within the context of such a handle (special cases)file - The requested local file Pathhandle - The assigned file handle through which the remote peer references this file.
May be null/empty if the request is due to some internal functionality
instead of due to peer requesting a handle to a file.options - The requested OpenOptionsattrs - The requested FileAttributesSeekableByteChannelIOException - If failed to opendefault FileLock tryLock(ServerSession session, SftpEventListenerManager subsystem, FileHandle fileHandle, Path file, String handle, Channel channel, long position, long size, boolean shared) throws IOException
session - The ServerSession through which the request was receivedsubsystem - The SFTP subsystem instance that manages the sessionfileHandle - The FileHandle representing the created channelfile - The requested local file Pathhandle - The assigned file handle through which the remote peer references this filechannel - The original Channel that was returned by
openFile(ServerSession, SftpEventListenerManager, FileHandle, Path, String, Set, FileAttribute...)position - The position at which the locked region is to start - must be non-negativesize - The size of the locked region; must be non-negative, and the sum
position + size must be non-negativeshared - true to request a shared lock, false to request an exclusive locknull
if the lock could not be acquired because another program holds an overlapping lockIOException - If failed to honor the requestFileChannel.tryLock(long, long, boolean)default void syncFileData(ServerSession session, SftpEventListenerManager subsystem, FileHandle fileHandle, Path file, String handle, Channel channel) throws IOException
session - The ServerSession through which the request was receivedsubsystem - The SFTP subsystem instance that manages the sessionfileHandle - The FileHandle representing the created channelfile - The requested local file Pathhandle - The assigned file handle through which the remote peer references this filechannel - The original Channel that was returned by
openFile(ServerSession, SftpEventListenerManager, FileHandle, Path, String, Set, FileAttribute...)IOException - If failed to execute the requestFileChannel.force(boolean),
OpenSSH - section 10default void closeFile(ServerSession session, SftpEventListenerManager subsystem, FileHandle fileHandle, Path file, String handle, Channel channel, Set<? extends OpenOption> options) throws IOException
session - The ServerSession through which the request was receivedsubsystem - The SFTP subsystem instance that manages the sessionfileHandle - The FileHandle representing the created channel - may be
null if not invoked within the context of such a handle (special cases)file - The requested local file Pathhandle - The assigned file handle through which the remote peer references this filechannel - The original Channel that was returned by
openFile(ServerSession, SftpEventListenerManager, FileHandle, Path, String, Set, FileAttribute...)options - The original options used to open the channelIOException - If failed to execute the requestdefault DirectoryStream<Path> openDirectory(ServerSession session, SftpEventListenerManager subsystem, DirectoryHandle dirHandle, Path dir, String handle) throws IOException
session - The ServerSession through which the request was receivedsubsystem - The SFTP subsystem instance that manages the sessiondirHandle - The DirectoryHandle representing the streamdir - The requested local directoryhandle - The assigned directory handle through which the remote peer references this directoryDirectoryStreamIOException - If failed to opendefault void closeDirectory(ServerSession session, SftpEventListenerManager subsystem, DirectoryHandle dirHandle, Path dir, String handle, DirectoryStream<Path> ds) throws IOException
session - The ServerSession through which the request was receivedsubsystem - The SFTP subsystem instance that manages the sessiondirHandle - The DirectoryHandle representing the stream - may be
null if not invoked within the context of such a handle (special cases)dir - The requested local directoryhandle - The assigned directory handle through which the remote peer references this directoryds - The disposed DirectoryStreamIOException - If failed to openCopyright © 2018–2019 The Apache Software Foundation. All rights reserved.