public abstract class AbstractScpClient extends AbstractLoggingBean implements ScpClient
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractScpClient.ScpOperationExecutor<T> |
ScpClient.Option| Modifier and Type | Field and Description |
|---|---|
static java.util.Set<ClientChannelEvent> |
COMMAND_WAIT_EVENTS |
logDEFAULT_EXEC_CHANNEL_EXIT_STATUS_TIMEOUT, DEFAULT_EXEC_CHANNEL_OPEN_TIMEOUT, SCP_EXEC_CHANNEL_EXIT_STATUS_TIMEOUT, SCP_EXEC_CHANNEL_OPEN_TIMEOUT| Modifier | Constructor and Description |
|---|---|
protected |
AbstractScpClient() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Collection<ScpClient.Option> |
addTargetIsDirectory(java.util.Collection<ScpClient.Option> options) |
void |
download(java.lang.String[] remote,
java.nio.file.Path local,
java.util.Collection<ScpClient.Option> options) |
void |
download(java.lang.String[] remote,
java.lang.String local,
java.util.Collection<ScpClient.Option> options) |
protected abstract void |
download(java.lang.String remote,
java.nio.file.FileSystem fs,
java.nio.file.Path local,
java.util.Collection<ScpClient.Option> options) |
void |
download(java.lang.String remote,
java.nio.file.Path local,
java.util.Collection<ScpClient.Option> options) |
void |
download(java.lang.String remote,
java.lang.String local,
java.util.Collection<ScpClient.Option> options) |
ClientSession |
getSession() |
protected void |
handleCommandExitStatus(java.lang.String cmd,
ClientChannel channel)
Invoked by the various
upload/download methods after having successfully
completed the remote copy command and (optionally) having received an exit status
from the remote server. |
protected void |
handleCommandExitStatus(java.lang.String cmd,
java.lang.Integer exitStatus)
Invoked by the various
upload/download methods after having successfully
completed the remote copy command and (optionally) having received an exit status
from the remote server |
boolean |
isOpen() |
protected ChannelExec |
openCommandChannel(ClientSession session,
java.lang.String cmd) |
protected abstract <T> void |
runUpload(java.lang.String remote,
java.util.Collection<ScpClient.Option> options,
java.util.Collection<T> local,
AbstractScpClient.ScpOperationExecutor<T> executor) |
void |
upload(java.nio.file.Path[] local,
java.lang.String remote,
java.util.Collection<ScpClient.Option> options) |
void |
upload(java.lang.String[] local,
java.lang.String remote,
java.util.Collection<ScpClient.Option> options) |
getSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateReceiveCommand, createSendCommand, download, download, download, download, download, downloadBytes, upload, upload, upload, upload, upload, upload, upload, upload, uploadgetClientSessionpublic static final java.util.Set<ClientChannelEvent> COMMAND_WAIT_EVENTS
public boolean isOpen()
public final ClientSession getSession()
getSession in interface SessionHolder<ClientSession>public void download(java.lang.String[] remote,
java.lang.String local,
java.util.Collection<ScpClient.Option> options)
throws java.io.IOException
public void download(java.lang.String[] remote,
java.nio.file.Path local,
java.util.Collection<ScpClient.Option> options)
throws java.io.IOException
public void download(java.lang.String remote,
java.nio.file.Path local,
java.util.Collection<ScpClient.Option> options)
throws java.io.IOException
public void download(java.lang.String remote,
java.lang.String local,
java.util.Collection<ScpClient.Option> options)
throws java.io.IOException
protected abstract void download(java.lang.String remote,
java.nio.file.FileSystem fs,
java.nio.file.Path local,
java.util.Collection<ScpClient.Option> options)
throws java.io.IOException
java.io.IOExceptionpublic void upload(java.lang.String[] local,
java.lang.String remote,
java.util.Collection<ScpClient.Option> options)
throws java.io.IOException
public void upload(java.nio.file.Path[] local,
java.lang.String remote,
java.util.Collection<ScpClient.Option> options)
throws java.io.IOException
protected abstract <T> void runUpload(java.lang.String remote,
java.util.Collection<ScpClient.Option> options,
java.util.Collection<T> local,
AbstractScpClient.ScpOperationExecutor<T> executor)
throws java.io.IOException
java.io.IOExceptionprotected void handleCommandExitStatus(java.lang.String cmd,
ClientChannel channel)
throws java.io.IOException
upload/download methods after having successfully
completed the remote copy command and (optionally) having received an exit status
from the remote server. If no exit status received within FactoryManager.CHANNEL_CLOSE_TIMEOUT
the no further action is taken. Otherwise, the exit status is examined to ensure it
is either OK or WARNING - if not, an ScpException is throwncmd - The attempted remote copy commandchannel - The ClientChannel through which the command was sent - Note:
then channel may be in the process of being closedjava.io.IOException - If failed the commandhandleCommandExitStatus(String, Integer)protected void handleCommandExitStatus(java.lang.String cmd,
java.lang.Integer exitStatus)
throws java.io.IOException
upload/download methods after having successfully
completed the remote copy command and (optionally) having received an exit status
from the remote servercmd - The attempted remote copy commandexitStatus - The exit status - if null then no status was reportedjava.io.IOException - If failed the commandprotected java.util.Collection<ScpClient.Option> addTargetIsDirectory(java.util.Collection<ScpClient.Option> options)
protected ChannelExec openCommandChannel(ClientSession session, java.lang.String cmd) throws java.io.IOException
java.io.IOException