Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sshtools.j2ssh
Class ScpClient

    java.lang.Object
      com.sshtools.j2ssh.ScpClient

public final class ScpClient
extends java.lang.Object

Implements a Secure Copy (SCP) client. This may be useful when the server does not support SFTP.

Since:
  0.2.0

Constructor Summary
`protected` | `ScpClient(java.io.File cwd, SshClient ssh, boolean verbose)` Creates an SCP client.

Method Summary
`void` | `get(java.lang.String localFile, java.lang.String[] remoteFiles, boolean recursive)` Downloads an array of remote files to the local computer.
`void` | `get(java.lang.String localFile, java.lang.String remoteFile, boolean recursive)` Downloads a remote file onto the local computer.
`void` | `put(java.lang.String[] localFiles, java.lang.String remoteFile, boolean recursive)` Uploads an array of local files onto the remote server.
`void` | `put(java.lang.String localFile, java.lang.String remoteFile, boolean recursive)` Uploads a local file onto the remote server.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ScpClient

    protected ScpClient(java.io.File cwd,
                        SshClient ssh,
                        boolean verbose)

  Creates an SCP client.

Parameters:
  `cwd` - The current local directory
  `ssh` - A connected SshClient
  `verbose` - Output verbose detail
Since:
  0.2.0

Method Detail

### put

    public void put(java.lang.String localFile,
                    java.lang.String remoteFile,
                    boolean recursive)
             throws java.io.IOException

  Uploads a local file onto the remote server.

  Parameters:
    `localFile` - The path to the local file relative to the local current directory; may be a file or directory
    `remoteFile` - The path on the remote server, may be a file or directory
    `recursive` - Copy the contents of a directory recursivly
  Throws:
    `java.io.IOException` - if an IO error occurs during the operation
  Since:
    0.2.0

### put

    public void put(java.lang.String[] localFiles,
                    java.lang.String remoteFile,
                    boolean recursive)
             throws java.io.IOException

  Uploads an array of local files onto the remote server.

  Parameters:
    `localFiles` - an array of local files; may be files or directories
    `remoteFile` - the path on the remote server, may be a file or directory1
    `recursive` - Copy the contents of directorys recursivly
  Throws:
    `java.io.IOException` - if an IO error occurs during the operation
  Since:
    0.2.0

### get

    public void get(java.lang.String localFile,
                    java.lang.String[] remoteFiles,
                    boolean recursive)
             throws java.io.IOException

  Downloads an array of remote files to the local computer.

  Parameters:
    `localFile` - The local path to place the files
    `remoteFiles` - The path of the remote files
    `recursive` - recursivly copy the contents of a directory
  Throws:
    `java.io.IOException` - if an IO error occurs during the operation
  Since:
    0.2.0

### get

    public void get(java.lang.String localFile,
                    java.lang.String remoteFile,
                    boolean recursive)
             throws java.io.IOException

  Downloads a remote file onto the local computer.

  Parameters:
    `localFile` - The path to place the file
    `remoteFile` - The path of the file on the remote server
    `recursive` - recursivly copy the contents of a directory
  Throws:
    `java.io.IOException` - if an IO error occurs during the operation
  Since:
    0.2.0

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD