/** * Create a new transport instance without a local repository. * * @param uri the URI used to access the remote repository. This must be the * URI passed to {@link #open(URIish)}. * @since 3.5 */ protected SshTransport(URIish uri) { super(uri); sch = SshSessionFactory.getInstance(); }
/** * Create a new transport instance. * * @param local * the repository this instance will fetch into, or push out of. * This must be the repository passed to * {@link #open(Repository, URIish)}. * @param uri * the URI used to access the remote repository. This must be the * URI passed to {@link #open(Repository, URIish)}. */ protected SshTransport(Repository local, URIish uri) { super(local, uri); sch = SshSessionFactory.getInstance(); }
MessageWriter stderr = new MessageWriter(); try (MessageWriter stdout = new MessageWriter()) { session = SshSessionFactory.getInstance().getSession(sshUri, provider, fs, 1000 * timeout); process = session.exec(command, 0); SshSessionFactory.getInstance().releaseSession(session);
/** * Create a new transport instance without a local repository. * * @param uri the URI used to access the remote repository. This must be the * URI passed to {@link #open(URIish)}. * @since 3.5 */ protected SshTransport(URIish uri) { super(uri); sch = SshSessionFactory.getInstance(); }
/** * Create a new transport instance without a local repository. * * @param uri the URI used to access the remote repository. This must be the * URI passed to {@link #open(URIish)}. * @since 3.5 */ protected SshTransport(URIish uri) { super(uri); sch = SshSessionFactory.getInstance(); }
/** * Create a new transport instance. * * @param local * the repository this instance will fetch into, or push out of. * This must be the repository passed to * {@link #open(Repository, URIish)}. * @param uri * the URI used to access the remote repository. This must be the * URI passed to {@link #open(Repository, URIish)}. */ protected SshTransport(Repository local, URIish uri) { super(local, uri); sch = SshSessionFactory.getInstance(); }
/** * Create a new transport instance. * * @param local * the repository this instance will fetch into, or push out of. * This must be the repository passed to * {@link #open(Repository, URIish)}. * @param uri * the URI used to access the remote repository. This must be the * URI passed to {@link #open(Repository, URIish)}. */ protected SshTransport(Repository local, URIish uri) { super(local, uri); sch = SshSessionFactory.getInstance(); }
public static void setupSsh(String sshDir) { if(SshSessionFactory.getInstance() == null || !SshSessionFactory.getInstance().getClass().getName().equals(GithubConfigSessionFactory.class.getName())) { log.debug("Setting SSH session factory for ssh dir path {}", sshDir); SshSessionFactory.setInstance(new GithubConfigSessionFactory(sshDir)); } }
public static <T> T useOpenShiftSessionFactory(Callable<T> callable) throws Exception { SshSessionFactory oldFactory = SshSessionFactory.getInstance(); try { SshSessionFactory.setInstance(new JschConfigSessionFactory() { @Override protected void configure(OpenSshConfig.Host hc, Session session) { session.setConfig("StrictHostKeyChecking", "no"); } }); return callable.call(); } finally { SshSessionFactory.setInstance(oldFactory); } } }
MessageWriter stderr = new MessageWriter(); try (MessageWriter stdout = new MessageWriter()) { session = SshSessionFactory.getInstance().getSession(sshUri, provider, fs, 1000 * timeout); process = session.exec(command, 0); SshSessionFactory.getInstance().releaseSession(session);