public final class ScpTo
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static int |
NUMBER_1000
Yes, it is 1000.
|
private static int |
NUMBER_1024
This is 2^10 (aka.
|
private static java.lang.String |
UTF_8
UTF-8.
|
| Modifier | Constructor and Description |
|---|---|
private |
ScpTo() |
| Modifier and Type | Method and Description |
|---|---|
private static int |
checkAck(java.io.InputStream inst)
method to check connection.
|
private static void |
cleanup(java.io.FileInputStream fis,
byte[] buf,
java.io.OutputStream out,
com.jcraft.jsch.Channel channel)
extracted cleanup to shorten scpTo.
|
private static java.lang.String |
createScpStatement(java.lang.String command,
long filesize,
java.lang.String path)
extracted statement creation to make scpTo shorter.
|
private static void |
handleException(java.lang.Exception exception,
java.io.FileInputStream fis)
extracted exception handling to shorten scpTo.
|
static void |
scpTo(java.lang.String path,
SshSession sshSession,
java.lang.String destination)
use this method to push something via ssh.
|
private static final java.lang.String UTF_8
private static final int NUMBER_1024
private static final int NUMBER_1000
public static void scpTo(java.lang.String path,
SshSession sshSession,
java.lang.String destination)
path - pathsshSession - sshSessiondestination - destinationprivate static void handleException(java.lang.Exception exception,
java.io.FileInputStream fis)
exception - exceptionfis - fisprivate static void cleanup(java.io.FileInputStream fis,
byte[] buf,
java.io.OutputStream out,
com.jcraft.jsch.Channel channel)
throws java.io.IOException
fis - fisbuf - bufout - outchannel - channeljava.io.IOException - IOExceptionprivate static java.lang.String createScpStatement(java.lang.String command,
long filesize,
java.lang.String path)
command - commandfilesize - filesizepath - pathprivate static int checkAck(java.io.InputStream inst)
throws java.io.IOException
inst - instjava.io.IOException - IOException