protected SftpFileObject(final AbstractFileName name, final SftpFileSystem fileSystem) throws FileSystemException { super(name, fileSystem); relPath = UriParser.decode(fileSystem.getRootName().getRelativeName( name)); }
protected SftpFileObject(final AbstractFileName name, final SftpFileSystem fileSystem) throws FileSystemException { super(name, fileSystem); relPath = UriParser.decode(fileSystem.getRootName().getRelativeName(name)); }
protected SftpFileObject(final AbstractFileName name, final SftpFileSystem fileSystem) throws FileSystemException { super(name, fileSystem); relPath = UriParser.decode(fileSystem.getRootName().getRelativeName(name)); }
protected SftpFileObject(final AbstractFileName name, final SftpFileSystem fileSystem) throws FileSystemException { super(name, fileSystem); relPath = UriParser.decode(fileSystem.getRootName().getRelativeName(name)); }
final Boolean userDirIsRoot = SftpFileSystemConfigBuilder.getInstance() .getUserDirIsRoot(getFileSystemOptions()); final String workingDirectory = getRootName().getPath(); if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue())) { try { throw new FileSystemException("vfs.provider.sftp/connect.error", getRootName(), e);
final Boolean userDirIsRoot = SftpFileSystemConfigBuilder.getInstance() .getUserDirIsRoot(getFileSystemOptions()); final String workingDirectory = getRootName().getPath(); if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue())) { try { throw new FileSystemException("vfs.provider.sftp/connect.error", getRootName(), e);
final Boolean userDirIsRoot = SftpFileSystemConfigBuilder.getInstance() .getUserDirIsRoot(getFileSystemOptions()); final String workingDirectory = getRootName().getPath(); if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue())) { try { throw new FileSystemException("vfs.provider.sftp/connect.error", getRootName(), e);
try final GenericFileName rootName = (GenericFileName) getRootName(); throw new FileSystemException("vfs.provider.sftp/connect.error", getRootName(), e);
/** * 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; } }
String workingDirectory = getRootName().getPath(); throw new FileSystemException("vfs.provider.sftp/connect.error", getRootName(), e);