<artifactId>org.slf4j.commons.logging</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.argeo.tp.misc</groupId>
+ <artifactId>org.freemarker</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.argeo.tp.bouncycastle</groupId>
<artifactId>bcprov</artifactId>
<groupId>org.argeo.tp.apache</groupId>
<artifactId>org.apache.mina.core</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.argeo.tp.apache</groupId>
+ <artifactId>org.apache.tomcat.jni</artifactId>
+ </dependency>
<dependency>
<groupId>org.argeo.tp.apache</groupId>
<artifactId>org.apache.sshd.core</artifactId>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="lib" path="lib/tomcat-jni-9.0.16.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
-Main-Class: org.argeo.sync.cli.Sync
+#Main-Class: org.argeo.sync.cli.Sync
additional.bundles = org.apache.sshd.common,\
org.slf4j.log4j12,\
org.slf4j.api,\
- org.apache.sshd.core
+ org.apache.sshd.core,\
+ bcprov,\
+ org.apache.tomcat.jni
+++ /dev/null
-/tomcat-jni-*.jar
import org.apache.sshd.client.config.keys.ClientIdentityLoader;
import org.apache.sshd.client.future.ConnectFuture;
import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.client.subsystem.sftp.SftpFileSystemProvider;
+import org.apache.sshd.client.subsystem.sftp.fs.SftpFileSystemProvider;
import org.apache.sshd.common.config.keys.FilePasswordProvider;
abstract class AbstractSsh {
}
void loadKey(String password, String keyPath) {
- try {
- KeyPair keyPair = ClientIdentityLoader.DEFAULT.loadClientIdentity(keyPath,
- FilePasswordProvider.of(password));
- session.addPublicKeyIdentity(keyPair);
- } catch (IOException | GeneralSecurityException e) {
- throw new IllegalStateException(e);
- }
+// try {
+// KeyPair keyPair = ClientIdentityLoader.DEFAULT.loadClientIdentity(keyPath,
+// FilePasswordProvider.of(password));
+// session.addPublicKeyIdentity(keyPair);
+// } catch (IOException | GeneralSecurityException e) {
+// throw new IllegalStateException(e);
+// }
}
void openSession(URI uri) {
import java.nio.file.FileSystem;
import java.nio.file.Path;
-import org.apache.sshd.client.subsystem.sftp.SftpFileSystem;
+import org.apache.sshd.client.subsystem.sftp.fs.SftpFileSystem;
public class Sftp extends AbstractSsh {
private URI uri;
import org.apache.sshd.client.config.keys.ClientIdentityLoader;
import org.apache.sshd.client.future.ConnectFuture;
import org.apache.sshd.client.session.ClientSession;
-import org.apache.sshd.client.subsystem.sftp.SftpFileSystem;
-import org.apache.sshd.client.subsystem.sftp.SftpFileSystemProvider;
+import org.apache.sshd.client.subsystem.sftp.fs.SftpFileSystem;
+import org.apache.sshd.client.subsystem.sftp.fs.SftpFileSystemProvider;
import org.apache.sshd.common.config.keys.FilePasswordProvider;
import org.apache.sshd.common.util.io.NoCloseInputStream;
import org.apache.sshd.common.util.io.NoCloseOutputStream;
try (SshClient client = SshClient.setUpDefaultClient()) {
client.start();
- boolean osAgent = false;
+ boolean osAgent = true;
SshAgentFactory agentFactory = osAgent ? new UnixAgentFactory() : new LocalAgentFactory();
// SshAgentFactory agentFactory = new LocalAgentFactory();
client.setAgentFactory(agentFactory);
System.out.print(keyPath + ": ");
Scanner s = new Scanner(System.in);
String password = s.next();
- KeyPair keyPair = ClientIdentityLoader.DEFAULT.loadClientIdentity(keyPath,
- FilePasswordProvider.of(password));
- sshAgent.addIdentity(keyPair, "NO COMMENT");
+// KeyPair keyPair = ClientIdentityLoader.DEFAULT.loadClientIdentity(keyPath,
+// FilePasswordProvider.of(password));
+// sshAgent.addIdentity(keyPair, "NO COMMENT");
}
- List<? extends Map.Entry<PublicKey, String>> identities = sshAgent.getIdentities();
- for (Map.Entry<PublicKey, String> entry : identities) {
- System.out.println(entry.getValue() + " : " + entry.getKey());
- }
+// List<? extends Map.Entry<PublicKey, String>> identities = sshAgent.getIdentities();
+// for (Map.Entry<PublicKey, String> entry : identities) {
+// System.out.println(entry.getValue() + " : " + entry.getKey());
+// }
ConnectFuture connectFuture = client.connect(login, host, port);
connectFuture.await();
<!-- <url>http://repo.argeo.org/data/docs/argeo-2.1/site/argeo-commons/</url> -->
<properties>
<version.argeo-commons>2.1.77-SNAPSHOT</version.argeo-commons>
- <version.argeo-tp>2.1.22</version.argeo-tp>
+ <version.argeo-tp>2.1.23</version.argeo-tp>
<!-- RPM -->
<argeo.rpm.release>7</argeo.rpm.release>
<argeo.rpm.stagingRepository>/srv/rpmfactory/argeo-osgi-2/el7</argeo.rpm.stagingRepository>