public abstract class AbstractSftpClientExtension extends AbstractLoggingBean implements SftpClientExtension, RawSftpClient
| Modifier and Type | Field and Description |
|---|---|
private SftpClient |
client |
private java.lang.String |
name |
private RawSftpClient |
raw |
private boolean |
supported |
logBY_NAME_COMPARATOR, NAME_EXTRACTORFALSE, TRUE| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSftpClientExtension(java.lang.String name,
SftpClient client,
RawSftpClient raw,
boolean supported) |
protected |
AbstractSftpClientExtension(java.lang.String name,
SftpClient client,
RawSftpClient raw,
java.util.Collection<java.lang.String> extras) |
protected |
AbstractSftpClientExtension(java.lang.String name,
SftpClient client,
RawSftpClient raw,
java.util.Map<java.lang.String,byte[]> extensions) |
| Modifier and Type | Method and Description |
|---|---|
protected Buffer |
checkExtendedReplyBuffer(Buffer buffer) |
protected void |
checkStatus(Buffer buffer) |
SftpClient |
getClient() |
protected Buffer |
getCommandBuffer(int extraSize) |
protected Buffer |
getCommandBuffer(java.lang.Object target) |
protected Buffer |
getCommandBuffer(java.lang.Object target,
int extraSize) |
java.lang.String |
getName() |
boolean |
isSupported() |
Buffer |
putTarget(Buffer buffer,
java.lang.Object target) |
Buffer |
receive(int id) |
int |
send(int cmd,
Buffer buffer) |
protected void |
sendAndCheckExtendedCommandStatus(Buffer buffer) |
protected int |
sendExtendedCommand(Buffer buffer) |
protected void |
throwStatusException(int id,
int substatus,
java.lang.String msg,
java.lang.String lang) |
protected void |
validateIncomingResponse(int cmd,
int id,
int type,
int length,
Buffer buffer) |
getSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindByName, getNameList, getNames, ofName, removeByNameall, any, ofprivate final java.lang.String name
private final SftpClient client
private final RawSftpClient raw
private final boolean supported
protected AbstractSftpClientExtension(java.lang.String name,
SftpClient client,
RawSftpClient raw,
java.util.Collection<java.lang.String> extras)
protected AbstractSftpClientExtension(java.lang.String name,
SftpClient client,
RawSftpClient raw,
java.util.Map<java.lang.String,byte[]> extensions)
protected AbstractSftpClientExtension(java.lang.String name,
SftpClient client,
RawSftpClient raw,
boolean supported)
public final java.lang.String getName()
getName in interface NamedResourcepublic final SftpClient getClient()
getClient in interface SftpClientExtensionSftpClient used to issue the extended commandprotected void sendAndCheckExtendedCommandStatus(Buffer buffer) throws java.io.IOException
java.io.IOExceptionprotected int sendExtendedCommand(Buffer buffer) throws java.io.IOException
java.io.IOExceptionpublic int send(int cmd,
Buffer buffer)
throws java.io.IOException
send in interface RawSftpClientcmd - Command to send - Note: only lower 8-bits are usedbuffer - The Buffer containing the command datajava.io.IOException - if failed to send commandpublic Buffer receive(int id) throws java.io.IOException
receive in interface RawSftpClientid - The expected request idBuffer containing the request idjava.io.IOException - If connection closed or interruptedpublic final boolean isSupported()
isSupported in interface OptionalFeatureprotected void checkStatus(Buffer buffer) throws java.io.IOException
java.io.IOExceptionpublic Buffer putTarget(Buffer buffer, java.lang.Object target)
buffer - The Buffertarget - A target path String or SftpClient.Handle or byte[] to be encoded in the bufferjava.lang.UnsupportedOperationException - If target is not one of the above supported typesprotected Buffer getCommandBuffer(java.lang.Object target)
target - A target path String or SftpClient.Handle or byte[] to be encoded in the bufferBuffer with the extension name setgetCommandBuffer(Object, int)protected Buffer getCommandBuffer(java.lang.Object target, int extraSize)
target - A target path String or SftpClient.Handle or byte[] to be encoded in the bufferextraSize - Extra size - beyond the path/handle to be allocatedBuffer with the extension name setgetCommandBuffer(int)protected Buffer getCommandBuffer(int extraSize)
extraSize - Extra size - besides the extension nameBuffer with the extension name setprotected Buffer checkExtendedReplyBuffer(Buffer buffer) throws java.io.IOException
buffer - The Buffer to checkBuffer 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 resultjava.io.IOException - If a non-SftpConstants.SSH_FX_OK result or
not a SftpConstants.SSH_FXP_EXTENDED_REPLY bufferprotected void validateIncomingResponse(int cmd,
int id,
int type,
int length,
Buffer buffer)
throws java.io.IOException
java.io.IOExceptionprotected void throwStatusException(int id,
int substatus,
java.lang.String msg,
java.lang.String lang)
throws java.io.IOException
java.io.IOException