camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 차정호 <jh...@barunmo.com>
Subject Camel FTP Component does not support ACCOUNT (ACCT) in RFC959 yet.
Date Fri, 27 Mar 2015 06:55:39 GMT
Dear Camel Developers.

 

I love Camel.

My Customer’s FTP environment has a little bit different usage.

They require “account” while ftp logging in.

But Camel has no input of account of ftp login.

 

In RFC959 : 

ACCOUNT (ACCT)

 

            The argument field is a Telnet string identifying the user's

            account.  The command is not necessarily related to the USER

            command, as some sites may require an account for login and

            others only for specific access, such as storing files.  In

            the latter case the command may arrive at any time.

 

            There are reply codes to differentiate these cases for the

            automation: when account information is required for login,

            the response to a successful PASSword command is reply code

            332.  On the other hand, if account information is NOT

            required for login, the reply to a successful PASSword

            command is 230; and if the account information is needed for

            a command issued later in the dialogue, the server should

            return a 332 or 532 reply depending on whether it stores

            (pending receipt of the ACCounT command) or discards the

            command, respectively.

 

 

I founded the source at org.apache.commons.net.ftp.FTPClient in Commons-net-
3.3.jar.

it uses “account” at ftp logging in. see the below source.

 

/**

     * Login to the FTP server using the provided username, password,

     * and account.  If no account is required by the server, only

     * the username and password, the account information is not used.

     * <p>

     * @param username The username to login under.

     * @param password The password to use.

     * @param account  The account to use.

     * @return True if successfully completed, false if not.

     * @exception FTPConnectionClosedException

     *      If the FTP server prematurely closes the connection as a result

     *      of the client being idle or some other reason causing the server

     *      to send FTP reply code 421.  This exception may be caught either

     *      as an IOException or independently as itself.

     * @exception IOException  If an I/O error occurs while either sending a

     *      command to the server or receiving a reply from the server.

     */

    public boolean login(String username, String password, String account)

 

But the source of org.apache.camel.component.file.remote.FtpOperations class

Does not support “account”, see the below source.

try {

            boolean login;

            if (username != null) {

                log.trace("Attempting to login user: {} using password:
{}", username, configuration.getPassword());

                login = client.login(username,
configuration.getPassword());  // <<<<<<<<<

            } else {

                log.trace("Attempting to login anonymous");

                login = client.login("anonymous", "");

            }

            log.trace("User {} logged in: {}", username != null ? username
: "anonymous", login);

            if (!login) {

                throw new
GenericFileOperationFailedException(client.getReplyCode(),
client.getReplyString());

            }

            client.setFileType(configuration.isBinary() ?
FTP.BINARY_FILE_TYPE : FTP.ASCII_FILE_TYPE);

        } catch (IOException e) {

            throw new
GenericFileOperationFailedException(client.getReplyCode(),
client.getReplyString(), e.getMessage(), e);

        }

 

Could you add the “account” in the Camel FTP Component?

 

Thanks a lot.

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message