You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by 차정호 <jh...@barunmo.com> on 2015/03/27 07:55:39 UTC

Camel FTP Component does not support ACCOUNT (ACCT) in RFC959 yet.

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.

 


Re: Camel FTP Component does not support ACCOUNT (ACCT) in RFC959 yet.

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Thanks for researching this. I have logged a ticket
https://issues.apache.org/jira/browse/CAMEL-8563

On Sat, Mar 28, 2015 at 6:12 AM, 차정호 <jh...@barunmo.com> wrote:
> Dear Mr. Ibsen,
>
> I checked Apache Commons Net FTP client API.
> FTPClient class supports "account" parameter in "login" method.
>
> boolean         login(String username, String password)
>                   Login to the FTP server using the provided username and password.
>
> boolean         login(String username, String password, String account)  <-- !!!
>                   Login to the FTP server using the provided username, password, and account.
>
> http://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html
>
>
> If you improve the Camel FTP component, I'll be very thankful to you.
>
> Thanks a lot.
>
> Jung-Ho Cha,
> a Camel rider.
>
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Friday, March 27, 2015 5:06 PM
> To: users@camel.apache.org
> Subject: Re: Camel FTP Component does not support ACCOUNT (ACCT) in RFC959 yet.
>
> 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: cibsen@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/
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@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/

RE: Camel FTP Component does not support ACCOUNT (ACCT) in RFC959 yet.

Posted by 차정호 <jh...@barunmo.com>.
Dear Mr. Ibsen,

I checked Apache Commons Net FTP client API.
FTPClient class supports "account" parameter in "login" method. 

boolean 	login(String username, String password)
                  Login to the FTP server using the provided username and password.

boolean 	login(String username, String password, String account)  <-- !!!
                  Login to the FTP server using the provided username, password, and account.

http://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html


If you improve the Camel FTP component, I'll be very thankful to you.

Thanks a lot.

Jung-Ho Cha,
a Camel rider.

-----Original Message-----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Sent: Friday, March 27, 2015 5:06 PM
To: users@camel.apache.org
Subject: Re: Camel FTP Component does not support ACCOUNT (ACCT) in RFC959 yet.

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: cibsen@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/


Re: Camel FTP Component does not support ACCOUNT (ACCT) in RFC959 yet.

Posted by Claus Ibsen <cl...@gmail.com>.
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: cibsen@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/