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 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 Collection<ScpClient.Option> |
addTargetIsDirectory(Collection<ScpClient.Option> options) |
void |
download(String[] remote,
Path local,
Collection<ScpClient.Option> options) |
void |
download(String[] remote,
String local,
Collection<ScpClient.Option> options) |
protected abstract void |
download(String remote,
FileSystem fs,
Path local,
Collection<ScpClient.Option> options) |
void |
download(String remote,
Path local,
Collection<ScpClient.Option> options) |
void |
download(String remote,
String local,
Collection<ScpClient.Option> options) |
ClientSession |
getSession() |
protected void |
handleCommandExitStatus(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(String cmd,
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 |
protected ChannelExec |
openCommandChannel(ClientSession session,
String cmd) |
protected abstract <T> void |
runUpload(String remote,
Collection<ScpClient.Option> options,
Collection<T> local,
AbstractScpClient.ScpOperationExecutor<T> executor) |
void |
upload(Path[] local,
String remote,
Collection<ScpClient.Option> options) |
void |
upload(String[] local,
String remote,
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 Set<ClientChannelEvent> COMMAND_WAIT_EVENTS
public final ClientSession getSession()
getSession in interface SessionHolder<ClientSession>public void download(String[] remote, String local, Collection<ScpClient.Option> options) throws IOException
download in interface ScpClientIOExceptionpublic void download(String[] remote, Path local, Collection<ScpClient.Option> options) throws IOException
download in interface ScpClientIOExceptionpublic void download(String remote, Path local, Collection<ScpClient.Option> options) throws IOException
download in interface ScpClientIOExceptionpublic void download(String remote, String local, Collection<ScpClient.Option> options) throws IOException
download in interface ScpClientIOExceptionprotected abstract void download(String remote, FileSystem fs, Path local, Collection<ScpClient.Option> options) throws IOException
IOExceptionpublic void upload(String[] local, String remote, Collection<ScpClient.Option> options) throws IOException
upload in interface ScpClientIOExceptionpublic void upload(Path[] local, String remote, Collection<ScpClient.Option> options) throws IOException
upload in interface ScpClientIOExceptionprotected abstract <T> void runUpload(String remote, Collection<ScpClient.Option> options, Collection<T> local, AbstractScpClient.ScpOperationExecutor<T> executor) throws IOException
IOExceptionprotected void handleCommandExitStatus(String cmd, ClientChannel channel) throws 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 closedIOException - If failed the commandhandleCommandExitStatus(String, Integer)protected void handleCommandExitStatus(String cmd, Integer exitStatus) throws 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 reportedIOException - If failed the commandprotected Collection<ScpClient.Option> addTargetIsDirectory(Collection<ScpClient.Option> options)
protected ChannelExec openCommandChannel(ClientSession session, String cmd) throws IOException
IOExceptionCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.