private void configureCommand(TransportCommand<?, ?> command) { command.setTimeout(this.timeout); if (this.transportConfigCallback != null) { command.setTransportConfigCallback(this.transportConfigCallback); } CredentialsProvider credentialsProvider = getCredentialsProvider(); if (credentialsProvider != null) { command.setCredentialsProvider(credentialsProvider); } }
@Override protected <T extends TransportCommand> T buildCommand(T command) { command.setTransportConfigCallback(transportConfigCallback); return command; }
/** * Configure a child command with the current configuration set in * {@code this} command * * @param childCommand * a {@link org.eclipse.jgit.api.TransportCommand} object. * @return {@code this} */ protected C configure(TransportCommand childCommand) { childCommand.setCredentialsProvider(credentialsProvider); childCommand.setTimeout(timeout); childCommand.setTransportConfigCallback(transportConfigCallback); return self(); } }
private <C extends GitCommand, T extends TransportCommand<C, ?>> C addAuthentication(T cmd) { return cmd.setTransportConfigCallback(authentication); }
if (sshPrivateKey != null) { final CredentialsProvider provider = credentialsProvider; command.setTransportConfigCallback(new TransportConfigCallback() { @Override public void configure(Transport transport) {
if (sshPrivateKey != null) { final CredentialsProvider provider = credentialsProvider; command.setTransportConfigCallback(new TransportConfigCallback() { @Override public void configure(Transport transport) {
private <T extends TransportCommand<?, ?>> void configureSsh(T cmd, PasswordMirrorCredential cred) { cmd.setTransportConfigCallback(transport -> { final SshTransport sshTransport = (SshTransport) transport; sshTransport.setSshSessionFactory(new JschConfigSessionFactory() { @Override protected void configure(Host host, Session session) { try { session.setHostKeyRepository( new MirrorHostKeyRepository(mirror.localRepo().parent().metaRepo())); session.setPassword(cred.password()); } catch (MirrorException e) { throw e; } catch (Exception e) { throw new MirrorException(e); } } }); }); }
private <T extends TransportCommand<?, ?>> void configureSsh(T cmd, PublicKeyMirrorCredential cred) { cmd.setTransportConfigCallback(transport -> { final SshTransport sshTransport = (SshTransport) transport; sshTransport.setSshSessionFactory(new JschConfigSessionFactory() { @Override protected void configure(Host host, Session session) { try { session.setHostKeyRepository( new MirrorHostKeyRepository(mirror.localRepo().parent().metaRepo())); session.setIdentityRepository(new MirrorIdentityRepository( cred.username() + '@' + host.getHostName(), cred)); } catch (MirrorException e) { throw e; } catch (Exception e) { throw new MirrorException(e); } } }); }); }
private <T extends TransportCommand<?, ?>> void configureSsh(T cmd, PasswordMirrorCredential cred) { cmd.setTransportConfigCallback(transport -> { final SshTransport sshTransport = (SshTransport) transport; sshTransport.setSshSessionFactory(new JschConfigSessionFactory() { @Override protected void configure(Host host, Session session) { try { session.setHostKeyRepository( new MirrorHostKeyRepository(mirror.localRepo().parent().metaRepo())); session.setPassword(cred.password()); } catch (MirrorException e) { throw e; } catch (Exception e) { throw new MirrorException(e); } } }); }); }
private <T extends TransportCommand<?, ?>> void configureSsh(T cmd, PasswordMirrorCredential cred) { cmd.setTransportConfigCallback(transport -> { final SshTransport sshTransport = (SshTransport) transport; sshTransport.setSshSessionFactory(new JschConfigSessionFactory() { @Override protected void configure(Host host, Session session) { try { session.setHostKeyRepository( new MirrorHostKeyRepository(mirror.localRepo().parent().metaRepo())); session.setPassword(cred.password()); } catch (MirrorException e) { throw e; } catch (Exception e) { throw new MirrorException(e); } } }); }); }
private <T extends TransportCommand<?, ?>> void configureSsh(T cmd, PublicKeyMirrorCredential cred) { cmd.setTransportConfigCallback(transport -> { final SshTransport sshTransport = (SshTransport) transport; sshTransport.setSshSessionFactory(new JschConfigSessionFactory() { @Override protected void configure(Host host, Session session) { try { session.setHostKeyRepository( new MirrorHostKeyRepository(mirror.localRepo().parent().metaRepo())); session.setIdentityRepository(new MirrorIdentityRepository( cred.username() + '@' + host.getHostName(), cred)); } catch (MirrorException e) { throw e; } catch (Exception e) { throw new MirrorException(e); } } }); }); }
private <T extends TransportCommand<?, ?>> void configureSsh(T cmd, PublicKeyMirrorCredential cred) { cmd.setTransportConfigCallback(transport -> { final SshTransport sshTransport = (SshTransport) transport; sshTransport.setSshSessionFactory(new JschConfigSessionFactory() { @Override protected void configure(Host host, Session session) { try { session.setHostKeyRepository( new MirrorHostKeyRepository(mirror.localRepo().parent().metaRepo())); session.setIdentityRepository(new MirrorIdentityRepository( cred.username() + '@' + host.getHostName(), cred)); } catch (MirrorException e) { throw e; } catch (Exception e) { throw new MirrorException(e); } } }); }); }
/** * Configure a child command with the current configuration set in * {@code this} command * * @param childCommand * @return {@code this} */ protected C configure(final TransportCommand childCommand) { childCommand.setCredentialsProvider(credentialsProvider); childCommand.setTimeout(timeout); childCommand.setTransportConfigCallback(transportConfigCallback); return self(); } }
/** * Configure a child command with the current configuration set in * {@code this} command * * @param childCommand * a {@link org.eclipse.jgit.api.TransportCommand} object. * @return {@code this} */ protected C configure(TransportCommand childCommand) { childCommand.setCredentialsProvider(credentialsProvider); childCommand.setTimeout(timeout); childCommand.setTransportConfigCallback(transportConfigCallback); return self(); } }