当前位置: 首页>>代码示例>>Java>>正文


Java User.authorize方法代码示例

本文整理汇总了Java中org.apache.ftpserver.ftplet.User.authorize方法的典型用法代码示例。如果您正苦于以下问题:Java User.authorize方法的具体用法?Java User.authorize怎么用?Java User.authorize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ftpserver.ftplet.User的用法示例。


在下文中一共展示了User.authorize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMaxDownloadRate

import org.apache.ftpserver.ftplet.User; //导入方法依赖的package包/类
private int getMaxDownloadRate(User user) {
    TransferRateRequest transferRateRequest = new TransferRateRequest();
    transferRateRequest = (TransferRateRequest) user
            .authorize(transferRateRequest);

    if (transferRateRequest != null) {
        return transferRateRequest.getMaxDownloadRate();
    } else {
        return 0;
    }
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:12,代码来源:UserManagerTestTemplate.java

示例2: getMaxUploadRate

import org.apache.ftpserver.ftplet.User; //导入方法依赖的package包/类
private int getMaxUploadRate(User user) {
    TransferRateRequest transferRateRequest = new TransferRateRequest();
    transferRateRequest = (TransferRateRequest) user
            .authorize(transferRateRequest);

    if (transferRateRequest != null) {
        return transferRateRequest.getMaxUploadRate();
    } else {
        return 0;
    }
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:12,代码来源:UserManagerTestTemplate.java

示例3: getMaxLoginNumber

import org.apache.ftpserver.ftplet.User; //导入方法依赖的package包/类
private int getMaxLoginNumber(User user) {
    ConcurrentLoginRequest concurrentLoginRequest = new ConcurrentLoginRequest(
            0, 0);
    concurrentLoginRequest = (ConcurrentLoginRequest) user
            .authorize(concurrentLoginRequest);

    if (concurrentLoginRequest != null) {
        return concurrentLoginRequest.getMaxConcurrentLogins();
    } else {
        return 0;
    }
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:13,代码来源:UserManagerTestTemplate.java

示例4: getMaxLoginPerIP

import org.apache.ftpserver.ftplet.User; //导入方法依赖的package包/类
private int getMaxLoginPerIP(User user) {
    ConcurrentLoginRequest concurrentLoginRequest = new ConcurrentLoginRequest(
            0, 0);
    concurrentLoginRequest = (ConcurrentLoginRequest) user
            .authorize(concurrentLoginRequest);

    if (concurrentLoginRequest != null) {
        return concurrentLoginRequest.getMaxConcurrentLoginsPerIP();
    } else {
        return 0;
    }
}
 
开发者ID:saaconsltd,项目名称:mina-ftpserver,代码行数:13,代码来源:UserManagerTestTemplate.java

示例5: save

import org.apache.ftpserver.ftplet.User; //导入方法依赖的package包/类
/**
 * Save user data. Store the properties.
 */
public synchronized void save(User usr) throws FtpException {
    // null value check
    if (usr.getName() == null) {
        throw new NullPointerException("User name is null.");
    }
    String thisPrefix = PREFIX + usr.getName() + '.';

    // set other properties
    userDataProp.setProperty(thisPrefix + ATTR_PASSWORD, getPassword(usr));

    String home = usr.getHomeDirectory();
    if (home == null) {
        home = "/";
    }
    userDataProp.setProperty(thisPrefix + ATTR_HOME, home);
    userDataProp.setProperty(thisPrefix + ATTR_ENABLE, usr.getEnabled());
    userDataProp.setProperty(thisPrefix + ATTR_WRITE_PERM, usr
            .authorize(new WriteRequest()) != null);
    userDataProp.setProperty(thisPrefix + ATTR_MAX_IDLE_TIME, usr
            .getMaxIdleTime());

    TransferRateRequest transferRateRequest = new TransferRateRequest();
    transferRateRequest = (TransferRateRequest) usr
            .authorize(transferRateRequest);

    if (transferRateRequest != null) {
        userDataProp.setProperty(thisPrefix + ATTR_MAX_UPLOAD_RATE,
                transferRateRequest.getMaxUploadRate());
        userDataProp.setProperty(thisPrefix + ATTR_MAX_DOWNLOAD_RATE,
                transferRateRequest.getMaxDownloadRate());
    } else {
        userDataProp.remove(thisPrefix + ATTR_MAX_UPLOAD_RATE);
        userDataProp.remove(thisPrefix + ATTR_MAX_DOWNLOAD_RATE);
    }

    // request that always will succeed
    ConcurrentLoginRequest concurrentLoginRequest = new ConcurrentLoginRequest(
            0, 0);
    concurrentLoginRequest = (ConcurrentLoginRequest) usr
            .authorize(concurrentLoginRequest);

    if (concurrentLoginRequest != null) {
        userDataProp.setProperty(thisPrefix + ATTR_MAX_LOGIN_NUMBER,
                concurrentLoginRequest.getMaxConcurrentLogins());
        userDataProp.setProperty(thisPrefix + ATTR_MAX_LOGIN_PER_IP,
                concurrentLoginRequest.getMaxConcurrentLoginsPerIP());
    } else {
        userDataProp.remove(thisPrefix + ATTR_MAX_LOGIN_NUMBER);
        userDataProp.remove(thisPrefix + ATTR_MAX_LOGIN_PER_IP);
    }

    saveUserData();
}
 
开发者ID:lgnlgn,项目名称:feluca,代码行数:57,代码来源:PropertiesUserManager.java


注:本文中的org.apache.ftpserver.ftplet.User.authorize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。