Java Code Examples for org.apache.sshd.common.Session#getUsername()

The following examples show how to use org.apache.sshd.common.Session#getUsername() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractSftpProviderTestCase.java    From commons-vfs with Apache License 2.0 5 votes vote down vote up
/**
 * Accepts only the known test user.
 */
@Override
public FileSystemView createFileSystemView(final Session session) throws IOException {
    final String userName = session.getUsername();
    if (!DEFAULT_USER.equals(userName)) {
        return null;
    }
    return new TestFileSystemView(AbstractVfsTestCase.getTestDirectory(), userName);
}
 
Example 2
Source File: ArtifactoryFileSystemFactory.java    From artifactory_ssh_proxy with Apache License 2.0 4 votes vote down vote up
/**
 * Create the appropriate user file system view.
 */
@Override
public FileSystemView createFileSystemView(final Session session) {
    final String userName = session.getUsername();
    return new ArtifactoryFileSystemView(afInfo, userName, isCaseInsensitive(), artifactoryAuthorizer);
}