Class SftpCommandMain

    • Field Detail

      • SFTP_PORT_OPTION

        public static final java.lang.String SFTP_PORT_OPTION
        Command line option used to indicate a non-default port number
        See Also:
        Constant Field Values
      • commandsMap

        private final java.util.Map<java.lang.String,​SftpCommandExecutor> commandsMap
      • cwdRemote

        private java.lang.String cwdRemote
      • cwdLocal

        private java.lang.String cwdLocal
      • showProgress

        private boolean showProgress
    • Constructor Detail

      • SftpCommandMain

        public SftpCommandMain​(SftpClient client)
    • Method Detail

      • doInteractive

        public void doInteractive​(java.io.BufferedReader stdin,
                                  java.io.PrintStream stdout,
                                  java.io.PrintStream stderr)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • resolveLocalPath

        protected java.lang.String resolveLocalPath​(java.lang.String pathArg)
      • resolveRemotePath

        protected java.lang.String resolveRemotePath​(java.lang.String pathArg)
      • appendFileAttributes

        protected <A extends java.lang.Appendable> A appendFileAttributes​(A stdout,
                                                                          SftpClient sftp,
                                                                          java.lang.String path,
                                                                          SftpClient.Attributes attrs)
                                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • getCurrentRemoteDirectory

        public java.lang.String getCurrentRemoteDirectory()
      • setCurrentRemoteDirectory

        public void setCurrentRemoteDirectory​(java.lang.String path)
      • getCurrentLocalDirectory

        public java.lang.String getCurrentLocalDirectory()
      • setCurrentLocalDirectory

        public void setCurrentLocalDirectory​(java.lang.String path)
      • isShowProgress

        public boolean isShowProgress()
      • setShowProgress

        public void setShowProgress​(boolean showProgress)
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface java.nio.channels.Channel
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.nio.channels.Channel
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • appendInfoValue

        public static <A extends java.lang.Appendable> A appendInfoValue​(A sb,
                                                                         java.lang.CharSequence name,
                                                                         java.lang.Object value)
                                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • resolveErrorDataHandlerStream

        private static java.io.OutputStream resolveErrorDataHandlerStream​(ClientSession session,
                                                                          org.slf4j.Logger logger)
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception