Class decoratorClass = SftpFileSystemConfigBuilder.getInstance().getSftpChannelDecorator(getFileSystemOptions()); if (decoratorClass != null) { try { String controlEncoding = SftpFileSystemConfigBuilder.getInstance().getControlEncoding(getFileSystemOptions()); if (controlEncoding != null) SftpFileSystemConfigBuilder.getInstance().getUserDirIsRoot(getFileSystemOptions()); String workingDirectory = getRootName().getPath(); String homeFolderOverride = SftpFileSystemConfigBuilder.getInstance().getHomeFolderOverride(getFileSystemOptions()); if (homeFolderOverride != null) getFileSystemOptions());
channel.connect(); final Boolean userDirIsRoot = SftpFileSystemConfigBuilder.getInstance() .getUserDirIsRoot(getFileSystemOptions()); final String workingDirectory = getRootName().getPath(); if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue())) { .getFileNameEncoding(getFileSystemOptions());
channel.connect(); final Boolean userDirIsRoot = SftpFileSystemConfigBuilder.getInstance() .getUserDirIsRoot(getFileSystemOptions()); final String workingDirectory = getRootName().getPath(); if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue())) { .getFileNameEncoding(getFileSystemOptions());
channel.connect(connectTimeoutMillis); final Boolean userDirIsRoot = SftpFileSystemConfigBuilder.getInstance() .getUserDirIsRoot(getFileSystemOptions()); final String workingDirectory = getRootName().getPath(); if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue())) { .getFileNameEncoding(getFileSystemOptions());
authData = UserAuthenticatorUtils.authenticate(getFileSystemOptions(), SftpFileProvider.AUTHENTICATOR_TYPES); UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, null), getFileSystemOptions());
/** * Ensures that the session link is established. * * @throws FileSystemException if a session cannot be created. */ private void ensureSession() throws FileSystemException { if (this.session == null || !this.session.isConnected()) { doCloseCommunicationLink(); // channel closed. e.g. by freeUnusedResources, but now we need it again Session session; UserAuthenticationData authData = null; try { final GenericFileName rootName = (GenericFileName) getRootName(); authData = UserAuthenticatorUtils.authenticate(getFileSystemOptions(), SftpFileProvider.AUTHENTICATOR_TYPES); session = SftpClientFactory.createConnection(rootName.getHostName(), rootName.getPort(), UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar(rootName.getUserName())), UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar(rootName.getPassword())), getFileSystemOptions()); } catch (final Exception e) { throw new FileSystemException("vfs.provider.sftp/connect.error", getRootName(), e); } finally { UserAuthenticatorUtils.cleanup(authData); } this.session = session; } }
/** * Ensures that the session link is established. * * @throws FileSystemException if a session cannot be created. */ private void ensureSession() throws FileSystemException { if (this.session == null || !this.session.isConnected()) { doCloseCommunicationLink(); // channel closed. e.g. by freeUnusedResources, but now we need it again Session session; UserAuthenticationData authData = null; try { final GenericFileName rootName = (GenericFileName) getRootName(); authData = UserAuthenticatorUtils.authenticate(getFileSystemOptions(), SftpFileProvider.AUTHENTICATOR_TYPES); session = SftpClientFactory.createConnection(rootName.getHostName(), rootName.getPort(), UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar(rootName.getUserName())), UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar(rootName.getPassword())), getFileSystemOptions()); } catch (final Exception e) { throw new FileSystemException("vfs.provider.sftp/connect.error", getRootName(), e); } finally { UserAuthenticatorUtils.cleanup(authData); } this.session = session; } }
/** * Ensures that the session link is established. * * @throws FileSystemException if a session cannot be created. */ private void ensureSession() throws FileSystemException { if (this.session == null || !this.session.isConnected()) { doCloseCommunicationLink(); // channel closed. e.g. by freeUnusedResources, but now we need it again Session session; UserAuthenticationData authData = null; try { final GenericFileName rootName = (GenericFileName) getRootName(); authData = UserAuthenticatorUtils.authenticate(getFileSystemOptions(), SftpFileProvider.AUTHENTICATOR_TYPES); session = SftpClientFactory.createConnection(rootName.getHostName(), rootName.getPort(), UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar(rootName.getUserName())), UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar(rootName.getPassword())), getFileSystemOptions()); } catch (final Exception e) { throw new FileSystemException("vfs.provider.sftp/connect.error", getRootName(), e); } finally { UserAuthenticatorUtils.cleanup(authData); } this.session = session; } }