Top Fields Constructors Methods
org.apache.sshd.sftp.client.extensions.helpers

public abstract Class AbstractSftpClientExtension

extends AbstractLoggingBean
implements SftpClientExtension, RawSftpClient
Class Inheritance
All Implemented Interfaces
org.apache.sshd.sftp.client.RawSftpClient, org.apache.sshd.sftp.client.extensions.SftpClientExtension, org.apache.sshd.sftp.client.SftpClientHolder, org.apache.sshd.common.OptionalFeature, org.apache.sshd.common.NamedResource
Known Direct Subclasses
org.apache.sshd.sftp.client.extensions.helpers.CopyDataExtensionImpl, org.apache.sshd.sftp.client.extensions.helpers.CopyFileExtensionImpl, org.apache.sshd.sftp.client.extensions.helpers.FilenameTranslationControlExtensionImpl, org.apache.sshd.sftp.client.extensions.helpers.SpaceAvailableExtensionImpl, org.apache.sshd.sftp.client.extensions.openssh.helpers.AbstractOpenSSHStatCommandExtension, org.apache.sshd.sftp.client.extensions.openssh.helpers.OpenSSHFsyncExtensionImpl, org.apache.sshd.sftp.client.extensions.openssh.helpers.OpenSSHLimitsExtensionImpl, org.apache.sshd.sftp.client.extensions.openssh.helpers.OpenSSHPosixRenameExtensionImpl, org.apache.sshd.sftp.client.extensions.helpers.AbstractCheckFileExtension, org.apache.sshd.sftp.client.extensions.helpers.AbstractMD5HashExtension
Imports
java.io.IOException, .StreamCorruptedException, java.time.Duration, java.util.Collection, .Map, .Objects, org.apache.sshd.common.SshException, org.apache.sshd.common.util.GenericUtils, .MapEntryUtils, .ValidateUtils, org.apache.sshd.common.util.buffer.Buffer, .ByteArrayBuffer, org.apache.sshd.common.util.logging.AbstractLoggingBean, org.apache.sshd.sftp.client.RawSftpClient, .SftpClient, .SftpClient.Handle, .SftpMessage, org.apache.sshd.sftp.client.extensions.SftpClientExtension, org.apache.sshd.sftp.client.impl.SftpResponse, .SftpStatus, org.apache.sshd.sftp.common.SftpConstants, .SftpException

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final SftpClient
private final String
private final RawSftpClient
private final boolean
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
protected
protected
AbstractSftpClientExtension(String name, SftpClient client, RawSftpClient raw, Map<String, byte[]> extensions)

protected
AbstractSftpClientExtension(String name, SftpClient client, RawSftpClient raw, boolean supported)

Method Summary

Modifier and TypeMethod and Description
protected Buffer

Returns:

The Buffer if this is an SftpConstants#SSH_FXP_EXTENDED_REPLY, or null if this is a SftpConstants#SSH_FXP_STATUS carrying an SftpConstants#SSH_FX_OK result
checkExtendedReplyBuffer
(Buffer
The Buffer to check
buffer
)

protected void
public final SftpClient
protected Buffer

Returns:

A Buffer with the extension name set
getCommandBuffer
(Object
A target path String or Handle or byte[] to be encoded in the buffer
target
)

protected Buffer

Returns:

A Buffer with the extension name set
getCommandBuffer
(Object
A target path String or Handle or byte[] to be encoded in the buffer
target
,
int
Extra size - beyond the path/handle to be allocated
extraSize
)

protected Buffer

Returns:

A Buffer with the extension name set
getCommandBuffer
(int
Extra size - besides the extension name
extraSize
)

public final String
public final boolean
public Buffer

Returns:

The updated buffer
putTarget
(Buffer
The Buffer
buffer
,
Object
A target path String or Handle or byte[] to be encoded in the buffer
target
)

public Buffer
receive(int
The expected request id
id
)

Implements org.apache.sshd.sftp.client.RawSftpClient.receive.

public Buffer
receive(int
The expected request id
id
,
long
The amount of time to wait for the response
timeout
)

Implements org.apache.sshd.sftp.client.RawSftpClient.receive.

public Buffer
receive(int
The expected request id
id
,
Duration
The amount of time to wait for the response
timeout
)

Implements org.apache.sshd.sftp.client.RawSftpClient.receive.

public int
send(int
Command to send - Note: only lower 8-bits are used
cmd
,
Buffer
The Buffer containing the command data
buffer
)

Implements org.apache.sshd.sftp.client.RawSftpClient.send.

protected void
protected int
protected void
public SftpMessage
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

clientback to summary
private final SftpClient client
nameback to summary
private final String name
rawback to summary
private final RawSftpClient raw
supportedback to summary
private final boolean supported

Constructor Detail

AbstractSftpClientExtensionback to summary
protected AbstractSftpClientExtension(String name, SftpClient client, RawSftpClient raw, Collection<String> extras)
AbstractSftpClientExtensionback to summary
protected AbstractSftpClientExtension(String name, SftpClient client, RawSftpClient raw, Map<String, byte[]> extensions)
AbstractSftpClientExtensionback to summary
protected AbstractSftpClientExtension(String name, SftpClient client, RawSftpClient raw, boolean supported)

Method Detail

checkExtendedReplyBufferback to summary
protected Buffer checkExtendedReplyBuffer(Buffer buffer) throws IOException
Parameters
buffer:Buffer

The Buffer to check

Returns:Buffer

The Buffer if this is an SftpConstants#SSH_FXP_EXTENDED_REPLY, or null if this is a SftpConstants#SSH_FXP_STATUS carrying an SftpConstants#SSH_FX_OK result

Exceptions
IOException:
If a non-SftpConstants#SSH_FX_OK result or not a SftpConstants#SSH_FXP_EXTENDED_REPLY buffer
checkStatusback to summary
protected void checkStatus(Buffer buffer) throws IOException
getClientback to summary
public final SftpClient getClient()

Implements org.apache.sshd.sftp.client.SftpClientHolder.getClient.

Annotations
@Override
getCommandBufferback to summary
protected Buffer getCommandBuffer(Object target)
Parameters
target:Object

A target path String or Handle or byte[] to be encoded in the buffer

Returns:Buffer

A Buffer with the extension name set

See Also
getCommandBuffer(Object, int)
getCommandBufferback to summary
protected Buffer getCommandBuffer(Object target, int extraSize)
Parameters
target:Object

A target path String or Handle or byte[] to be encoded in the buffer

extraSize:int

Extra size - beyond the path/handle to be allocated

Returns:Buffer

A Buffer with the extension name set

See Also
getCommandBuffer(int)
getCommandBufferback to summary
protected Buffer getCommandBuffer(int extraSize)
Parameters
extraSize:int

Extra size - besides the extension name

Returns:Buffer

A Buffer with the extension name set

getNameback to summary
public final String getName()

Implements org.apache.sshd.common.NamedResource.getName.

Returns:String

Doc from org.apache.sshd.common.NamedResource.getName.

The resource name

Annotations
@Override
isSupportedback to summary
public final boolean isSupported()

Implements org.apache.sshd.common.OptionalFeature.isSupported.

Annotations
@Override
putTargetback to summary
public Buffer putTarget(Buffer buffer, Object target)
Parameters
buffer:Buffer

The Buffer

target:Object

A target path String or Handle or byte[] to be encoded in the buffer

Returns:Buffer

The updated buffer

Exceptions
UnsupportedOperationException:
If target is not one of the above supported types
receiveback to summary
public Buffer receive(int id) throws IOException

Implements org.apache.sshd.sftp.client.RawSftpClient.receive.

Parameters
id:int

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

The expected request id

Returns:Buffer

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

The received response Buffer containing the request id

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

If connection closed or interrupted

receiveback to summary
public Buffer receive(int id, long timeout) throws IOException

Implements org.apache.sshd.sftp.client.RawSftpClient.receive.

Parameters
id:int

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

The expected request id

timeout:long

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

The amount of time to wait for the response

Returns:Buffer

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

The received response Buffer containing the request id

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

If connection closed or interrupted

receiveback to summary
public Buffer receive(int id, Duration timeout) throws IOException

Implements org.apache.sshd.sftp.client.RawSftpClient.receive.

Parameters
id:int

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

The expected request id

timeout:Duration

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

The amount of time to wait for the response

Returns:Buffer

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

The received response Buffer containing the request id

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.sftp.client.RawSftpClient.receive.

If connection closed or interrupted

sendback to summary
public int send(int cmd, Buffer buffer) throws IOException

Implements org.apache.sshd.sftp.client.RawSftpClient.send.

Parameters
cmd:int

Doc from org.apache.sshd.sftp.client.RawSftpClient.send.

Command to send - Note: only lower 8-bits are used

buffer:Buffer

Doc from org.apache.sshd.sftp.client.RawSftpClient.send.

The Buffer containing the command data

Returns:int

Doc from org.apache.sshd.sftp.client.RawSftpClient.send.

The assigned request id

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.sftp.client.RawSftpClient.send.

if failed to send command

sendAndCheckExtendedCommandStatusback to summary
protected void sendAndCheckExtendedCommandStatus(Buffer buffer) throws IOException
sendExtendedCommandback to summary
protected int sendExtendedCommand(Buffer buffer) throws IOException
throwStatusExceptionback to summary
protected void throwStatusException(int id, SftpStatus status) throws IOException
writeback to summary
public SftpMessage write(int cmd, Buffer buffer) throws IOException

Implements org.apache.sshd.sftp.client.RawSftpClient.write.

Annotations
@Override