diff --git a/java-scpclient/pom.xml b/java-scpclient/pom.xml index 03fdf880f1a46cd51800c8d24eda0b3e47142e17..e538e3d7c37d7b9243742e776eb27da743648a85 100644 --- a/java-scpclient/pom.xml +++ b/java-scpclient/pom.xml @@ -70,7 +70,7 @@ <dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> - <version>0.1.54</version> + <version>0.1.55</version> </dependency> <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api --> <dependency> diff --git a/java-scpclient/src/main/java/cz/it4i/fiji/scpclient/ScpClient.java b/java-scpclient/src/main/java/cz/it4i/fiji/scpclient/ScpClient.java index cbcfc0f167898e0da975439476409618f29bd0d5..2f3dc3b627c23be9320385c3e443c4c9541b9bf6 100644 --- a/java-scpclient/src/main/java/cz/it4i/fiji/scpclient/ScpClient.java +++ b/java-scpclient/src/main/java/cz/it4i/fiji/scpclient/ScpClient.java @@ -63,6 +63,8 @@ public class ScpClient implements Closeable { } }; + private int port = 22; + public ScpClient(String hostName, String username, byte[] privateKeyFile) throws JSchException { @@ -89,6 +91,10 @@ public class ScpClient implements Closeable { } init(hostName, userName, id); } + + public void setPort(int port) { + this.port = port; + } private void init(String initHostName, String initUsername, Identity privateKeyFile) throws JSchException @@ -363,7 +369,7 @@ public class ScpClient implements Closeable { private Session getConnectedSession() throws JSchException { if (session == null) { - session = jsch.getSession(username, hostName); + session = jsch.getSession(username, hostName, port); UserInfo ui = new P_UserInfo();