sirius.biz.storage.vfs.ftp.BridgeUser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sirius-biz Show documentation
Show all versions of sirius-biz Show documentation
Provides a framework for building web based business applications
/*
* 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 extends Authority> 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