Class ScpShell

    • Field Detail

      • ENV_PWD

        public static final java.lang.String ENV_PWD
        The "PWD" environment variable
        See Also:
        Constant Field Values
      • ENV_HOME

        public static final java.lang.String ENV_HOME
        The "HOME" environment variable
        See Also:
        Constant Field Values
      • ENV_LANG

        public static final java.lang.String ENV_LANG
        Key for the language - format "en_US.UTF-8"
        See Also:
        Constant Field Values
      • variables

        protected final java.util.Map<java.lang.String,​java.lang.Object> variables
      • nameEncodingCharset

        protected final java.nio.charset.Charset nameEncodingCharset
      • sendBufferSize

        protected final int sendBufferSize
      • receiveBufferSize

        protected final int receiveBufferSize
      • currentDir

        protected java.nio.file.Path currentDir
      • homeDir

        protected java.nio.file.Path homeDir
    • Method Detail

      • println

        protected void println​(java.lang.String cmd,
                               java.lang.Object x,
                               java.io.OutputStream out,
                               java.nio.charset.Charset cs)
      • signalError

        protected void signalError​(java.lang.String cmd,
                                   java.lang.String errorMsg)
      • signalError

        protected void signalError​(java.lang.String cmd,
                                   java.lang.String errorMsg,
                                   java.nio.charset.Charset cs)
      • run

        public void run()
      • readLine

        protected java.lang.String readLine​(java.io.Reader reader)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • handleCommandLine

        protected boolean handleCommandLine​(java.lang.String command)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • prepareEnvironment

        protected void prepareEnvironment​(Environment environ)
      • handleUnsupportedCommand

        protected void handleUnsupportedCommand​(java.lang.String command,
                                                java.lang.String[] argv)
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parse

        protected java.util.List<java.lang.String[]> parse​(java.lang.String command)
      • printenv

        protected void printenv​(java.lang.String[] argv)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • resolveEnvironmentVariable

        protected java.lang.String resolveEnvironmentVariable​(java.lang.String varName,
                                                              java.util.Map<java.lang.String,​java.lang.String> envValues)
      • unset

        protected void unset​(java.lang.String[] argv)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • scp

        protected void scp​(java.lang.String[] argv)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doScp

        protected void doScp​(java.lang.String path,
                             boolean optR,
                             boolean optT,
                             boolean optF,
                             boolean optD,
                             boolean optP)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • echo

        protected void echo​(java.lang.String[] argv)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • pwd

        protected void pwd​(java.lang.String[] argv)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • cd

        protected void cd​(java.lang.String[] argv)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • updatePwdEnvVariable

        protected void updatePwdEnvVariable​(java.nio.file.Path pwd)
      • ls

        protected void ls​(java.lang.String[] argv)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doLs

        protected void doLs​(java.lang.String cmd,
                            java.lang.String path,
                            boolean optListAll,
                            boolean optLong,
                            boolean optFullTime)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception