Examples of DefaultFtpReply


Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

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

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

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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

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

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

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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

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

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

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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

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

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

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

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

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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

        } else {
            sb.append("uploadrate      : 0\n");
            sb.append("downloadrate    : 0\n");
        }
        sb.append('\n');
        session.write(new DefaultFtpReply(FtpReply.REPLY_200_COMMAND_OKAY, sb
                .toString()));
    }
View Full Code Here

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

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

Examples of org.apache.ftpserver.ftplet.DefaultFtpReply

            // decode it
           
            LOG.warn(
                    "Client sent command that could not be decoded: {}",
                    ((ProtocolDecoderException)cause).getHexdump());
            session.write(new DefaultFtpReply(FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "Invalid character in command"));
        } else if (cause instanceof WriteToClosedSessionException) {
            WriteToClosedSessionException writeToClosedSessionException =
                (WriteToClosedSessionException) cause;
            LOG.warn(
                            "Client closed connection before all replies could be sent, last reply was {}",
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.