Top Description Fields Constructors Methods
org.apache.sshd.sftp.server

public Class SftpSubsystem

extends AbstractSftpSubsystemHelper
implements Runnable, FileSystemAware, ExecutorServiceCarrier, AsyncCommand, ChannelDataReceiver
Class Inheritance
All Implemented Interfaces
org.apache.sshd.server.channel.ChannelDataReceiver, java.io.Closeable, java.lang.AutoCloseable, org.apache.sshd.server.command.AsyncCommand, org.apache.sshd.server.command.AsyncCommandStreamsAware, org.apache.sshd.server.command.AsyncCommandErrorStreamAware, org.apache.sshd.server.command.AsyncCommandOutputStreamAware, org.apache.sshd.server.command.AsyncCommandInputStreamAware, org.apache.sshd.server.command.Command, org.apache.sshd.server.command.CommandDirectStreamsAware, org.apache.sshd.server.command.CommandDirectErrorStreamAware, org.apache.sshd.server.command.CommandDirectOutputStreamAware, org.apache.sshd.server.command.CommandDirectInputStreamAware, org.apache.sshd.server.command.CommandLifecycle, org.apache.sshd.common.util.threads.ExecutorServiceCarrier, org.apache.sshd.common.file.FileSystemAware, java.lang.Runnable
Imports
java.io.EOFException, .IOException, .InputStream, .OutputStream, .StreamCorruptedException, java.net.UnknownServiceException, java.nio.charset.StandardCharsets, java.nio.file.AccessDeniedException, .FileSystem, .FileSystemLoopException, .FileSystems, .Files, .LinkOption, .NoSuchFileException, .NotDirectoryException, .Path, java.util.Arrays, .Collection, .Comparator, .Deque, .LinkedList, .Map, .Objects, .TreeMap, java.util.concurrent.BlockingQueue, .ConcurrentHashMap, .Future, .LinkedBlockingQueue, java.util.concurrent.atomic.AtomicBoolean, .AtomicLong, .AtomicReference, org.apache.sshd.common.Factory, .FactoryManager, org.apache.sshd.common.channel.AbstractChannel, .AbstractChannel.PacketValidator, .BufferedIoOutputStream, .LocalWindow, org.apache.sshd.common.digest.BuiltinDigests, .DigestFactory, org.apache.sshd.common.file.FileSystemAware, org.apache.sshd.common.io.IoInputStream, .IoOutputStream, org.apache.sshd.common.random.Random, org.apache.sshd.common.session.Session, org.apache.sshd.common.util.ValidateUtils, org.apache.sshd.common.util.buffer.Buffer, .BufferUtils, .ByteArrayBuffer, org.apache.sshd.common.util.io.IoUtils, org.apache.sshd.common.util.threads.CloseableExecutorService, .ExecutorServiceCarrier, .ThreadUtils, org.apache.sshd.server.Environment, .ExitCallback, org.apache.sshd.server.channel.ChannelDataReceiver, .ChannelSession, .ChannelSessionAware, org.apache.sshd.server.command.AsyncCommand, .AsyncCommandErrorStreamAware, .CommandDirectErrorStreamAware, org.apache.sshd.server.session.ServerSession, org.apache.sshd.sftp.SftpModuleProperties, org.apache.sshd.sftp.client.fs.SftpPath, .WithFileAttributeCache, org.apache.sshd.sftp.common.SftpConstants, .SftpException, .SftpHelper

SFTP subsystem
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
protected final Buffer
protected ExitCallback
protected static final Buffer
protected final AtomicBoolean
protected Path
protected Environment
protected CloseableExecutorService
protected final Map<String, byte[]>
protected int
protected FileSystem
protected final Map<String, Handle>
protected int
protected int
protected IoOutputStream
protected Future<?>
protected Random
protected final BlockingQueue<Buffer>
protected final AtomicLong
private final ServerSession
protected Deque<String>
protected int
protected byte[]
Inherited from org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper:
DEFAULT_ACL_SUPPORTED_MASKDEFAULT_OPEN_SSH_EXTENSIONSDEFAULT_OPEN_SSH_EXTENSIONS_NAMESDEFAULT_SUPPORTED_CLIENT_EXTENSIONS

Constructor Summary

AccessConstructor and Description
public
SftpSubsystem(ChannelSession
The ChannelSession through which the command was received
channel
,
SftpSubsystemConfigurator configurator)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

protected void
public int
data(ChannelSession
The caller to which this ChannelDataReceiver is assigned. Never null.
channel
,
byte[]
Holds the bytes received. This buffer belongs to the caller, and it might get reused by the caller as soon as this method returns.
buf
,
int
buf[start] is the first byte that received from the client.
start
,
int
the length of the bytes received. Can be zero.
len
)

Implements org.apache.sshd.server.channel.ChannelDataReceiver.data.

Called when the server receives additional bytes from the client.

public void
destroy(ChannelSession
The ChannelSession through which the command has been received
channel
)

Implements org.apache.sshd.server.command.CommandLifecycle.destroy.

This method is called by the SSH server to destroy the command because the client has disconnected somehow.

protected void
doBlock(int id, String handle, long offset, long length, int mask)

Implements abstract org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doBlock.

protected void
doCheckFileHash(int id, String targetType, String target, Collection<String> algos, long startOffset, long length, int blockSize, Buffer buffer)

Implements abstract org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doCheckFileHash.

protected void
protected void
doCopyData(int id, String readHandle, long readOffset, long readLength, String writeHandle, long writeOffset)

Implements abstract org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doCopyData.

protected void
protected Map<String, Object>
protected void
protected byte[]
doMD5Hash(int id, String targetType, String target, long startOffset, long length, byte[] quickCheckHash)

Implements abstract org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doMD5Hash.

protected String
doOpen(int
Request id
id
,
String
Path
path
,
int
Open mode flags - see SSH_FXF_XXX flags
pflags
,
int
Access mode flags - see ACE4_XXX flags
access
,
Map<String, Object>
Requested attributes
attrs
)

Implements abstract org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doOpen.

protected String
protected void
protected void
protected int
doRead(int id, String handle, long offset, int length, byte[] data, int doff, AtomicReference<Boolean> eof)

Implements abstract org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doRead.

protected void
protected void
protected void
doUnblock(int id, String handle, long offset, long length)

Implements abstract org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doUnblock.

protected void
protected void
doWrite(int id, String handle, long offset, int length, byte[] data, int doff, int remaining)

Implements abstract org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doWrite.

protected String

Returns:

the file handle
generateFileHandle
(Path
to generate a handle for
file
)

Generates a file handle, which is used as key in a Map to record open file handles across requests.

public Path
public CloseableExecutorService
public ServerSession
public int
protected void
protected Buffer
protected ChannelDataReceiver
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

protected void
public void
setErrorStream(OutputStream
The OutputStream used by the shell to write its errors
err
)

Implements org.apache.sshd.server.command.CommandDirectErrorStreamAware.setErrorStream.

Set the error stream that can be used by the shell to write its errors.

public void
setExitCallback(ExitCallback
The ExitCallback to call when shell is closed
callback
)

Implements org.apache.sshd.server.command.Command.setExitCallback.

Set the callback that the shell has to call when it is closed.

public void
setFileSystem(FileSystem
the file system
fileSystem
)

Implements org.apache.sshd.common.file.FileSystemAware.setFileSystem.

Set the file system in which this shell will be executed.

public void
setInputStream(InputStream
The InputStream used by the shell to read input.
in
)

Implements org.apache.sshd.server.command.CommandDirectInputStreamAware.setInputStream.

Set the input stream that can be used by the shell to read input.

public void
setIoErrorStream(IoOutputStream
The IoOutputStream used by the shell to write its errors
err
)

Implements org.apache.sshd.server.command.AsyncCommandErrorStreamAware.setIoErrorStream.

Set the error stream that can be used by the shell to write its errors.

public void
setIoInputStream(IoInputStream
The IoInputStream used by the shell to read input
in
)

Implements org.apache.sshd.server.command.AsyncCommandInputStreamAware.setIoInputStream.

Set the input stream that can be used by the shell to read input.

public void
setIoOutputStream(IoOutputStream
The IoOutputStream used by the shell to write its output
out
)

Implements org.apache.sshd.server.command.AsyncCommandOutputStreamAware.setIoOutputStream.

Set the output stream that can be used by the shell to write its output.

public void
setOutputStream(OutputStream
The OutputStream used by the shell to write its output
out
)

Implements org.apache.sshd.server.command.CommandDirectOutputStreamAware.setOutputStream.

Set the output stream that can be used by the shell to write its output.

public void
start(ChannelSession
The ChannelSession through which the command has been received
channel
,
Environment env)

Implements org.apache.sshd.server.command.CommandLifecycle.start.

Starts the command execution.

Inherited from org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper:
addMissingAttributeaddSftpEventListenerappendAclSupportedExtensionappendExtensionsappendNewlineExtensionappendOpenSSHExtensionsappendSupported2ExtensionappendSupportedExtensionappendVendorIdExtensionappendVersionsExtensioncheckSymlinkStatecheckVersionCompatibilitydoBlockdoCheckFileHashdoCheckFileHashdoClosedoCopyDatadoCopyFiledoCopyFiledoCopyFiledoExtendeddoFSetStatdoFStatdoLinkdoLinkdoLStatdoLStatdoMakeDirectorydoMakeDirectorydoMD5HashdoMD5HashdoOpendoOpenDirdoOpenSSHFsyncdoOpenSSHHardLinkdoOpenSSHHardLinkdoOpenSSHLimitsdoPosixRenamedoReaddoReadDirdoReadLinkdoReadLinkdoRealPathdoRealPathV345doRealPathV6doRemovedoRemovedoRemoveDirectorydoRemoveDirectorydoRemoveFiledoRenamedoRenamedoRenamedoSetAttributesdoSetStatdoSetStatdoSpaceAvailabledoSpaceAvailabledoStatdoStatdoSymLinkdoSymLinkdoTextSeekdoUnblockdoUnsupporteddoUnsupportedExtensiondoVersionSelectdoWriteexecuteExtendedCommandgetAttributesgetAttributesgetErrorStatusDataHandlergetFileSystemAccessorgetLongNamegetLongNamegetLongNamegetLongNamegetOpenSSHLimitsExtensionInfogetPathResolutionLinkOptiongetServerChannelSessiongetSftpEventListenerProxygetShortNamegetSupportedClientExtensionsgetUnsupportedAttributePolicyhandleReadFileAttributesExceptionhandleSetFileAttributeFailurehandleUnknownStatusFileAttributeshandleUnsupportedAttributeshandleUserPrincipalLookupServiceExceptionnormalizeprocessreadAttrsreadFileAttributesremoveSftpEventListenerresolveAclSupportedCapabilitiesresolveFileresolveFileAttributesresolveMissingFileAttributesresolveMissingFileAttributeValueresolveNewlineValueresolveNormalizedLocationresolveOpenSSHExtensionsresolvePathResolutionFollowLinksresolveReportedFileAttributessendAttrssendHandlesendLinksendPathsendStatussendStatussendStatussetFileAccessControlsetFileAttributesetFileAttributessetFileExtensionssetFileOwnershipsetFilePermissionssetFileRawViewAttributesetFileTimesignalOpenFailuresignalRemovalPreConditionFailuretoGrouptoUservalidateHandlevalidateParentExistWithNoSymlinksIfNeverFollowSymlinksvalidateProposedVersionvalidateRealPathwriteAttrswriteDirEntrywriteDirEntry