public abstract class AbstractScpClient extends org.apache.sshd.common.util.logging.AbstractLoggingBean implements ScpClient
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractScpClient.ScpOperationExecutor<T> |
ScpClient.Optionlog| 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) |
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 |
boolean |
isOpen() |
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) |
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendCommandOption, createReceiveCommand, createSendCommand, download, download, download, download, download, downloadBytes, getSession, upload, upload, upload, upload, upload, upload, upload, upload, uploadgetSessionContextgetClientSessionpublic boolean isOpen()
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
CoreModuleProperties.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 received non-OK exit statusprotected Collection<ScpClient.Option> addTargetIsDirectory(Collection<ScpClient.Option> options)
protected ChannelExec openCommandChannel(ClientSession session, String cmd) throws IOException
IOExceptionCopyright © 2018–2021 The Apache Software Foundation. All rights reserved.