All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sirius.biz.storage.vfs.ftp.BridgeUser Maven / Gradle / Ivy

There is a newer version: 9.6
Show newest version
/*
 * Made with all the love in the world
 * by scireum in Remshalden, Germany
 *
 * Copyright by scireum GmbH
 * http://www.scireum.de - [email protected]
 */

package sirius.biz.storage.vfs.ftp;

import org.apache.ftpserver.ftplet.Authority;
import org.apache.ftpserver.ftplet.AuthorizationRequest;
import org.apache.ftpserver.ftplet.User;
import sirius.web.security.UserInfo;

import java.util.Collections;
import java.util.List;

/**
 * Provides a simple bridge between {@link UserInfo} and the FTP server.
 */
class BridgeUser implements User {

    private UserInfo authUser;

    BridgeUser(UserInfo authUser) {
        this.authUser = authUser;
    }

    @Override
    public String getName() {
        return authUser.getUserName();
    }

    @Override
    public AuthorizationRequest authorize(AuthorizationRequest request) {
        return request;
    }

    @Override
    public List getAuthorities() {
        return Collections.emptyList();
    }

    @Override
    public List getAuthorities(Class clazz) {
        return Collections.emptyList();
    }

    @Override
    public boolean getEnabled() {
        return true;
    }

    @Override
    public String getHomeDirectory() {
        return "/";
    }

    @Override
    public int getMaxIdleTime() {
        return 0;
    }

    @Override
    public String getPassword() {
        return null;
    }

    protected UserInfo getAuthUser() {
        return authUser;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy