Class AbstractScpClient

    • Field Detail

      • COMMAND_WAIT_EVENTS

        public static final java.util.Set<ClientChannelEvent> COMMAND_WAIT_EVENTS
    • Constructor Detail

      • AbstractScpClient

        protected AbstractScpClient()
    • Method Detail

      • isOpen

        public boolean isOpen()
      • download

        public void download​(java.lang.String[] remote,
                             java.lang.String local,
                             java.util.Collection<ScpClient.Option> options)
                      throws java.io.IOException
        Specified by:
        download in interface ScpClient
        Throws:
        java.io.IOException
      • download

        public void download​(java.lang.String[] remote,
                             java.nio.file.Path local,
                             java.util.Collection<ScpClient.Option> options)
                      throws java.io.IOException
        Specified by:
        download in interface ScpClient
        Throws:
        java.io.IOException
      • download

        public void download​(java.lang.String remote,
                             java.nio.file.Path local,
                             java.util.Collection<ScpClient.Option> options)
                      throws java.io.IOException
        Specified by:
        download in interface ScpClient
        Throws:
        java.io.IOException
      • download

        public void download​(java.lang.String remote,
                             java.lang.String local,
                             java.util.Collection<ScpClient.Option> options)
                      throws java.io.IOException
        Specified by:
        download in interface ScpClient
        Throws:
        java.io.IOException
      • download

        protected abstract void download​(java.lang.String remote,
                                         java.nio.file.FileSystem fs,
                                         java.nio.file.Path local,
                                         java.util.Collection<ScpClient.Option> options)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • upload

        public void upload​(java.lang.String[] local,
                           java.lang.String remote,
                           java.util.Collection<ScpClient.Option> options)
                    throws java.io.IOException
        Specified by:
        upload in interface ScpClient
        Throws:
        java.io.IOException
      • upload

        public void upload​(java.nio.file.Path[] local,
                           java.lang.String remote,
                           java.util.Collection<ScpClient.Option> options)
                    throws java.io.IOException
        Specified by:
        upload in interface ScpClient
        Throws:
        java.io.IOException
      • runUpload

        protected abstract <T> void runUpload​(java.lang.String remote,
                                              java.util.Collection<ScpClient.Option> options,
                                              java.util.Collection<T> local,
                                              AbstractScpClient.ScpOperationExecutor<T> executor)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • handleCommandExitStatus

        protected void handleCommandExitStatus​(java.lang.String cmd,
                                               ClientChannel channel)
                                        throws java.io.IOException
        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. 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 thrown
        Parameters:
        cmd - The attempted remote copy command
        channel - The ClientChannel through which the command was sent - Note: then channel may be in the process of being closed
        Throws:
        java.io.IOException - If failed the command
        See Also:
        handleCommandExitStatus(String, Integer)
      • handleCommandExitStatus

        protected void handleCommandExitStatus​(java.lang.String cmd,
                                               java.lang.Integer exitStatus)
                                        throws java.io.IOException
        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
        Parameters:
        cmd - The attempted remote copy command
        exitStatus - The exit status - if null then no status was reported
        Throws:
        java.io.IOException - If failed the command
      • openCommandChannel

        protected ChannelExec openCommandChannel​(ClientSession session,
                                                 java.lang.String cmd)
                                          throws java.io.IOException
        Throws:
        java.io.IOException