Package org.apache.ftpserver.usermanager

Examples of org.apache.ftpserver.usermanager.TransferRateRequest


        sb.append("homedirectory   : ").append(user.getHomeDirectory()).append("\n");
        sb.append("writepermission : ").append(user.authorize(new WriteRequest())).append("\n");
        sb.append("enableflag      : ").append(user.getEnabled()).append("\n");
        sb.append("idletime        : ").append(user.getMaxIdleTime()).append("\n");
       
        TransferRateRequest transferRateRequest = new TransferRateRequest();
        transferRateRequest = (TransferRateRequest) session.getUser().authorize(transferRateRequest);
       
        if(transferRateRequest != null) {
            sb.append("uploadrate      : ").append(transferRateRequest.getMaxUploadRate()).append("\n");
            sb.append("downloadrate    : ").append(transferRateRequest.getMaxDownloadRate()).append("\n");
        } else {
            sb.append("uploadrate      : 0\n");
            sb.append("downloadrate    : 0\n");
        }
        sb.append('\n');
View Full Code Here


   
    /* (non-Javadoc)
     * @see org.apache.ftpserver.FtpDataConnection2#transferFromClient(java.io.OutputStream)
     */
    public final long transferFromClient(final OutputStream out) throws IOException {
        TransferRateRequest transferRateRequest = new TransferRateRequest();
        transferRateRequest = (TransferRateRequest) session.getUser().authorize(transferRateRequest);
        int maxRate = 0;
        if(transferRateRequest != null) {
            maxRate = transferRateRequest.getMaxUploadRate();
        }
       
        InputStream is = getDataInputStream();
        try {
            return transfer(is, out, maxRate);
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.ftpserver.FtpDataConnection2#transferToClient(java.io.InputStream)
     */
    public final long transferToClient(final InputStream in) throws IOException {
        TransferRateRequest transferRateRequest = new TransferRateRequest();
        transferRateRequest = (TransferRateRequest) session.getUser().authorize(transferRateRequest);
        int maxRate = 0;
        if(transferRateRequest != null) {
            maxRate = transferRateRequest.getMaxDownloadRate();
        }
       
        OutputStream out = getDataOutputStream();
        try {
            return transfer(in, out, maxRate);
View Full Code Here

     * @seeorg.apache.ftpserver.FtpDataConnection2#transferFromClient(java.io.
     * OutputStream)
     */
    public final long transferFromClient(final OutputStream out)
            throws IOException {
        TransferRateRequest transferRateRequest = new TransferRateRequest();
        transferRateRequest = (TransferRateRequest) session.getUser()
                .authorize(transferRateRequest);
        int maxRate = 0;
        if (transferRateRequest != null) {
            maxRate = transferRateRequest.getMaxUploadRate();
        }

        InputStream is = getDataInputStream();
        try {
            return transfer(is, out, maxRate);
View Full Code Here

     * @see
     * org.apache.ftpserver.FtpDataConnection2#transferToClient(java.io.InputStream
     * )
     */
    public final long transferToClient(final InputStream in) throws IOException {
        TransferRateRequest transferRateRequest = new TransferRateRequest();
        transferRateRequest = (TransferRateRequest) session.getUser()
                .authorize(transferRateRequest);
        int maxRate = 0;
        if (transferRateRequest != null) {
            maxRate = transferRateRequest.getMaxDownloadRate();
        }

        OutputStream out = getDataOutputStream();
        try {
            return transfer(in, out, maxRate);
View Full Code Here

                user.authorize(new WriteRequest())).append("\n");
        sb.append("enableflag      : ").append(user.getEnabled()).append("\n");
        sb.append("idletime        : ").append(user.getMaxIdleTime()).append(
                "\n");

        TransferRateRequest transferRateRequest = new TransferRateRequest();
        transferRateRequest = (TransferRateRequest) session.getUser()
                .authorize(transferRateRequest);

        if (transferRateRequest != null) {
            sb.append("uploadrate      : ").append(
                    transferRateRequest.getMaxUploadRate()).append("\n");
            sb.append("downloadrate    : ").append(
                    transferRateRequest.getMaxDownloadRate()).append("\n");
        } else {
            sb.append("uploadrate      : 0\n");
            sb.append("downloadrate    : 0\n");
        }
        sb.append('\n');
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.usermanager.TransferRateRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.