Package org.apache.ftpserver

Examples of org.apache.ftpserver.ServerDataConnectionFactory


       
        // reset state variables
        session.resetState();
       
        // set data connection
        ServerDataConnectionFactory dataCon = session.getDataConnection();
       
        try {
            InetSocketAddress dataConAddress = dataCon.initPassiveDataConnection();
            // get connection info
            int servPort = dataConAddress.getPort();
           
            // send connection info to client
            String portStr = "|||" + servPort + '|';
View Full Code Here


            return;
        }
       
        // check argument
        arg = arg.toUpperCase();
        ServerDataConnectionFactory dcon = session.getDataConnection();
        if(arg.equals("C")) {
            dcon.setSecure(false);
            session.write(FtpReplyUtil.translate(session, request, context, FtpReply.REPLY_200_COMMAND_OKAY, "PROT", null));
        }
        else if(arg.equals("P")) {
            if(session.getListener().getDataConnectionConfiguration().getSslConfiguration() == null) {
                session.write(FtpReplyUtil.translate(session, request, context, 431, "PROT", null));
            }
            else {
                dcon.setSecure(true);
                session.write(FtpReplyUtil.translate(session, request, context, FtpReply.REPLY_200_COMMAND_OKAY, "PROT", null));
            }
        }
        else {
            session.write(FtpReplyUtil.translate(session, request, context, FtpReply.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER, "PROT", null));
View Full Code Here

       
        // reset state variables
        session.resetState();
       
        // set data connection
        ServerDataConnectionFactory dataCon = session.getDataConnection();
        InetAddress externalPassiveAddress = session.getListener().getDataConnectionConfiguration().getPassiveExernalAddress();
       
        try {
            InetSocketAddress dataConAddress = dataCon.initPassiveDataConnection();

           
            // get connection info
            InetAddress servAddr;
            if(externalPassiveAddress != null) {
View Full Code Here

        // reset state variables
        session.resetState();

        // set data connection
        ServerDataConnectionFactory dataCon = session.getDataConnection();
        InetAddress externalPassiveAddress = session.getListener()
                .getDataConnectionConfiguration().getPassiveExernalAddress();

        try {
            InetSocketAddress dataConAddress = dataCon
                    .initPassiveDataConnection();

            // get connection info
            InetAddress servAddr;
            if (externalPassiveAddress != null) {
View Full Code Here

        // reset state variables
        session.resetState();

        // set data connection
        ServerDataConnectionFactory dataCon = session.getDataConnection();

        try {
            InetSocketAddress dataConAddress = dataCon
                    .initPassiveDataConnection();
            // get connection info
            int servPort = dataConAddress.getPort();

            // send connection info to client
View Full Code Here

            return;
        }

        // check argument
        arg = arg.toUpperCase();
        ServerDataConnectionFactory dcon = session.getDataConnection();
        if (arg.equals("C")) {
            dcon.setSecure(false);
            session.write(FtpReplyUtil.translate(session, request, context,
                    FtpReply.REPLY_200_COMMAND_OKAY, "PROT", null));
        } else if (arg.equals("P")) {
            if (session.getListener().getDataConnectionConfiguration()
                    .getSslConfiguration() == null) {
                session.write(FtpReplyUtil.translate(session, request, context,
                        431, "PROT", null));
            } else {
                dcon.setSecure(true);
                session.write(FtpReplyUtil.translate(session, request, context,
                        FtpReply.REPLY_200_COMMAND_OKAY, "PROT", null));
            }
        } else {
            session
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.ServerDataConnectionFactory

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.