Package org.apache.sshd.cli.client
Class SftpCommandMain
java.lang.Object
org.apache.sshd.cli.CliSupport
org.apache.sshd.cli.client.SshClientCliSupport
org.apache.sshd.cli.client.SftpCommandMain
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,org.apache.sshd.sftp.client.SftpClientHolder
public class SftpCommandMain
extends SshClientCliSupport
implements org.apache.sshd.sftp.client.SftpClientHolder, Channel
TODO Add javadoc
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private class
private static class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.sshd.sftp.client.SftpClient
private final Map
<String, SftpCommandExecutor> private String
private String
static final String
Command line option used to indicate a non-default port numberprivate boolean
Fields inherited from class org.apache.sshd.cli.client.SshClientCliSupport
SSH_CLIENT_PORT_OPTION
Fields inherited from class org.apache.sshd.cli.CliSupport
DEFAULT_IO_SERVICE_FACTORY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <A extends Appendable>
AappendFileAttributes
(A stdout, org.apache.sshd.sftp.client.SftpClient sftp, String path, org.apache.sshd.sftp.client.SftpClient.Attributes attrs) static <A extends Appendable>
AappendInfoValue
(A sb, CharSequence name, Object value) void
close()
void
doInteractive
(BufferedReader stdin, PrintStream stdout, PrintStream stderr) final org.apache.sshd.sftp.client.SftpClient
boolean
isOpen()
boolean
static void
private static OutputStream
resolveErrorDataHandlerStream
(org.apache.sshd.client.session.ClientSession session, org.slf4j.Logger logger) protected String
resolveLocalPath
(String pathArg) protected String
resolveRemotePath
(String pathArg) static org.apache.sshd.sftp.client.SftpClientFactory
resolveSftpClientFactory
(org.apache.sshd.client.session.ClientSession session) static org.apache.sshd.sftp.client.SftpVersionSelector.NamedVersionSelector
resolveVersionSelector
(org.apache.sshd.client.session.ClientSession session) void
void
void
setShowProgress
(boolean showProgress) Methods inherited from class org.apache.sshd.cli.client.SshClientCliSupport
isArgumentedOption, resolveClientEnvironment, resolveClientEnvironment, resolveClientPtyModes, resolveClientPtyOptions, resolveClientPtyOptions, resolveHost, resolveIdentityFile, resolveLoggingTargetStream, resolveLoggingTargetStream, setupClient, setupClientSession, setupDefaultClient, setupLogging, setupServerKeyVerifier, setupSessionExtensions, setupSessionIdentities, setupSessionUserInteraction
Methods inherited from class org.apache.sshd.cli.CliSupport
createLoggingIoServiceEventListener, createLoggingSessionListener, printFieldsValues, resolveBuiltinIoServiceFactory, resolveIoServiceFactory, setupCiphers, setupCiphers, setupCompressions, setupCompressions, setupIoServiceFactory, setupMacs, setupMacs, setupUserAuthFactories, splitCommandLineArguments
-
Field Details
-
SFTP_PORT_OPTION
Command line option used to indicate a non-default port number- See Also:
-
client
private final org.apache.sshd.sftp.client.SftpClient client -
commandsMap
-
cwdRemote
-
cwdLocal
-
showProgress
private boolean showProgress
-
-
Constructor Details
-
SftpCommandMain
public SftpCommandMain(org.apache.sshd.sftp.client.SftpClient client)
-
-
Method Details
-
getClient
public final org.apache.sshd.sftp.client.SftpClient getClient()- Specified by:
getClient
in interfaceorg.apache.sshd.sftp.client.SftpClientHolder
-
doInteractive
public void doInteractive(BufferedReader stdin, PrintStream stdout, PrintStream stderr) throws Exception - Throws:
Exception
-
resolveLocalPath
-
resolveRemotePath
-
appendFileAttributes
protected <A extends Appendable> A appendFileAttributes(A stdout, org.apache.sshd.sftp.client.SftpClient sftp, String path, org.apache.sshd.sftp.client.SftpClient.Attributes attrs) throws IOException - Throws:
IOException
-
getCurrentRemoteDirectory
-
setCurrentRemoteDirectory
-
getCurrentLocalDirectory
-
setCurrentLocalDirectory
-
isShowProgress
public boolean isShowProgress() -
setShowProgress
public void setShowProgress(boolean showProgress) -
isOpen
public boolean isOpen() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
appendInfoValue
public static <A extends Appendable> A appendInfoValue(A sb, CharSequence name, Object value) throws IOException - Throws:
IOException
-
resolveSftpClientFactory
public static org.apache.sshd.sftp.client.SftpClientFactory resolveSftpClientFactory(org.apache.sshd.client.session.ClientSession session) -
resolveVersionSelector
public static org.apache.sshd.sftp.client.SftpVersionSelector.NamedVersionSelector resolveVersionSelector(org.apache.sshd.client.session.ClientSession session) -
resolveErrorDataHandlerStream
private static OutputStream resolveErrorDataHandlerStream(org.apache.sshd.client.session.ClientSession session, org.slf4j.Logger logger) -
main
- Throws:
Exception
-