Package org.apache.ftpserver.ftplet

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply


            DataConnectionFactory connFactory = session.getDataConnection();
            if (connFactory instanceof IODataConnectionFactory) {
                InetAddress address = ((IODataConnectionFactory) connFactory)
                        .getInetAddress();
                if (address == null) {
                    session.write(new DefaultFtpReply(
                            FtpReply.REPLY_503_BAD_SEQUENCE_OF_COMMANDS,
                            "PORT or PASV must be issued first"));
                    return;
                }
            }
View Full Code Here


            DataConnectionFactory connFactory = session.getDataConnection();
            if (connFactory instanceof IODataConnectionFactory) {
                InetAddress address = ((IODataConnectionFactory) connFactory)
                        .getInetAddress();
                if (address == null) {
                    session.write(new DefaultFtpReply(
                            FtpReply.REPLY_503_BAD_SEQUENCE_OF_COMMANDS,
                            "PORT or PASV must be issued first"));
                    return;
                }
            }
View Full Code Here

            DataConnectionFactory connFactory = session.getDataConnection();
            if (connFactory instanceof IODataConnectionFactory) {
                InetAddress address = ((IODataConnectionFactory) connFactory)
                        .getInetAddress();
                if (address == null) {
                    session.write(new DefaultFtpReply(
                            FtpReply.REPLY_503_BAD_SEQUENCE_OF_COMMANDS,
                            "PORT or PASV must be issued first"));
                    return;
                }
            }
View Full Code Here

        // reset state variables
        session.resetState();

        // send timezone data
        String timezone = TIMEZONE_FMT.format(new Date());
        session.write(new DefaultFtpReply(FtpReply.REPLY_200_COMMAND_OKAY,
                timezone));
    }
View Full Code Here

*
*/
public class DefaultFtpReplyTest extends TestCase {

    public void testSingleLineToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo bar");

        assertEquals("123 foo bar\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123 foo bar\r\n", response.toString());
    }
   
    public void testSingleLineWithTrailingLineFeedToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo bar\n");

        assertEquals("123 foo bar\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123 foo bar\r\n", response.toString());
    }

    public void testCarriageReturnToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo \rbar\r\n");

        assertEquals("123 foo bar\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123 foo bar\r\n", response.toString());
    }
   
    public void testNullToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, (String) null);

        assertEquals("123 \r\n", response.toString());
    }
View Full Code Here

        assertEquals("123 \r\n", response.toString());
    }

    public void testMultipleLinesToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo\nbar\nbaz");

        assertEquals("123-foo\r\nbar\r\n123 baz\r\n", response.toString());
    }
View Full Code Here

        assertEquals("123-foo\r\nbar\r\n123 baz\r\n", response.toString());
    }

    public void testMultipleLinesEndWithNewlineToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, "foo\nbar\nbaz\n");

        assertEquals("123-foo\r\nbar\r\n123 baz\r\n", response.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.ftplet.DefaultFtpReply

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.