List of usage examples for org.apache.commons.vfs2.provider.sftp SftpFileSystemConfigBuilder setIdentities
@Deprecated public void setIdentities(final FileSystemOptions opts, final File... identityFiles) throws FileSystemException
From source file:hadoopInstaller.installation.Installer.java
private void configureVFS2SFTP() throws InstallationFatalError { getLog().trace("HadoopInstaller.Configure.SFTP.Start"); //$NON-NLS-1$ FileSystemOptions options;/*ww w.j av a 2 s . c o m*/ options = new FileSystemOptions(); SftpFileSystemConfigBuilder builder = SftpFileSystemConfigBuilder.getInstance(); try { builder.setUserDirIsRoot(options, false); /* * TODO-- ssh-ask * * In the case of ask, the UserInfo object should be passed with * builder.setUserInfo() */ builder.setStrictHostKeyChecking(options, this.configuration.getStrictHostKeyChecking() ? "yes" : "no"); //$NON-NLS-1$//$NON-NLS-2$ getLog().trace("HadoopInstaller.Configure.StrictHostKeyChecking", //$NON-NLS-1$ this.configuration.getStrictHostKeyChecking()); builder.setKnownHosts(options, new File(this.configuration.getSshKnownHosts())); getLog().trace("HadoopInstaller.Configure.KnownHosts", //$NON-NLS-1$ this.configuration.getSshKnownHosts()); File identities[] = { new File(getConfig().getSshKeyFile()) }; getLog().trace("HadoopInstaller.Configure.PrivateKeyFile", //$NON-NLS-1$ getConfig().getSshKeyFile()); builder.setIdentities(options, identities); /* * TODO-- ssh-ask * * what if the identities file is password protected? do we need to * use setUserInfo? */ } catch (FileSystemException e) { throw new InstallationFatalError(e, "HadoopInstaller.Configure.SFTP.Fail"); //$NON-NLS-1$ } this.sftpOptions = options; getLog().debug("HadoopInstaller.Configure.SFTP.Success"); //$NON-NLS-1$ }