Examples of DefaultFtpReply


Examples of org.apache.ftpserver.DefaultFtpReply

            // 24-10-2007 - added check if PORT or PASV is issued, see https://issues.apache.org/jira/browse/FTPSERVER-110
            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;
                }
            }
           
            // call Ftplet.onUploadStart() method
View Full Code Here

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

*
*/
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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

        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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

        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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

        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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

        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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

        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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

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

    public void testArrayLinesToString() {
        DefaultFtpReply response = new DefaultFtpReply(123, new String[] {
                "foo", "bar", "baz" });

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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

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

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

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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

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

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

        assertEquals("123-foo\r\n bar\r\n123 baz\r\n", response.toString());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.