Class ScpHelper

    • Method Detail

      • receiveFileStream

        public void receiveFileStream​(java.io.OutputStream local,
                                      int bufferSize)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • receive

        public void receive​(java.nio.file.Path local,
                            boolean recursive,
                            boolean shouldBeDir,
                            boolean preserve,
                            int bufferSize)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • receive

        protected void receive​(ScpReceiveLineHandler handler)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • receiveDir

        public void receiveDir​(java.lang.String header,
                               java.nio.file.Path local,
                               ScpTimestamp time,
                               boolean preserve,
                               int bufferSize)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • receiveFile

        public void receiveFile​(java.lang.String header,
                                java.nio.file.Path local,
                                ScpTimestamp time,
                                boolean preserve,
                                int bufferSize)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • receiveStream

        public void receiveStream​(java.lang.String header,
                                  ScpTargetStreamResolver resolver,
                                  ScpTimestamp time,
                                  boolean preserve,
                                  int bufferSize)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readLine

        public java.lang.String readLine()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • readLine

        public java.lang.String readLine​(boolean canEof)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • send

        public void send​(java.util.Collection<java.lang.String> paths,
                         boolean recursive,
                         boolean preserve,
                         int bufferSize)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • sendPaths

        public void sendPaths​(java.util.Collection<? extends java.nio.file.Path> paths,
                              boolean recursive,
                              boolean preserve,
                              int bufferSize)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • send

        protected void send​(java.nio.file.Path local,
                            boolean recursive,
                            boolean preserve,
                            int bufferSize,
                            java.nio.file.LinkOption... options)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • resolveLocalPath

        public java.nio.file.Path resolveLocalPath​(java.lang.String basedir,
                                                   java.lang.String subpath)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • resolveLocalPath

        public java.nio.file.Path resolveLocalPath​(java.lang.String commandPath)
                                            throws java.io.IOException,
                                                   java.nio.file.InvalidPathException
        Parameters:
        commandPath - The command path using the local file separator
        Returns:
        The resolved absolute and normalized local Path
        Throws:
        java.io.IOException - If failed to resolve the path
        java.nio.file.InvalidPathException - If invalid local path value
      • sendFile

        public void sendFile​(java.nio.file.Path local,
                             boolean preserve,
                             int bufferSize)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • sendStream

        public void sendStream​(ScpSourceStreamResolver resolver,
                               boolean preserve,
                               int bufferSize)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • validateOperationReadyCode

        protected void validateOperationReadyCode​(java.lang.String command,
                                                  java.lang.Object location,
                                                  int readyCode,
                                                  boolean eofAllowed)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • validateAckReplyCode

        protected void validateAckReplyCode​(java.lang.String command,
                                            java.lang.Object location,
                                            int replyCode,
                                            boolean eofAllowed)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • validateCommandStatusCode

        protected void validateCommandStatusCode​(java.lang.String command,
                                                 java.lang.Object location,
                                                 int statusCode,
                                                 boolean eofAllowed)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • sendDir

        public void sendDir​(java.nio.file.Path local,
                            boolean preserve,
                            int bufferSize)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getOctalPermissions

        public static java.lang.String getOctalPermissions​(java.util.Collection<java.nio.file.attribute.PosixFilePermission> perms)
      • parseOctalPermissions

        public static java.util.Set<java.nio.file.attribute.PosixFilePermission> parseOctalPermissions​(java.lang.String str)
      • sendWarning

        protected void sendWarning​(java.lang.String message)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • sendError

        protected void sendError​(java.lang.String message)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • sendResponseMessage

        protected void sendResponseMessage​(int level,
                                           java.lang.String message)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • sendWarning

        public static <O extends java.io.OutputStream> O sendWarning​(O out,
                                                                     java.lang.String message)
                                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • sendError

        public static <O extends java.io.OutputStream> O sendError​(O out,
                                                                   java.lang.String message)
                                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • sendResponseMessage

        public static <O extends java.io.OutputStream> O sendResponseMessage​(O out,
                                                                             int level,
                                                                             java.lang.String message)
                                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • getExitStatusName

        public static java.lang.String getExitStatusName​(java.lang.Integer exitStatus)
      • ack

        public void ack()
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • readAck

        public int readAck​(boolean canEof)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object