Hi

The camel ftp component uses Apache Commons Net as FTP client. I
suggest to check their website what it supports. And if it supports
Account, then yeah for sure we can add support for that too in
camel-ftp.

http://commons.apache.org/proper/commons-net/

On Fri, Mar 27, 2015 at 7:55 AM, 차정호 <jh...@barunmo.com> wrote:
> 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.
>
>
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to