commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Cole" <>
Subject Re: How to set Data port on Commons FTP
Date Fri, 18 Dec 2009 17:18:53 GMT
Will there ever be more than one instance of that client running on that
computer? If so, when the second instance tries to use those ports, it will
throw an exception, won't it?

----- Original Message ----- 
From: "Sathish Gopal" <>
To: <>
Sent: Friday, December 18, 2009 1:05 AM
Subject: Reg: How to set Data port on Commons FTP

Hi all,

I'm pretty new to Commons API. I'm trying to use FTP API which is part
of Commons net and don't know much about FTP protocol either.

My requirement is to create new file via FTP.

I followed this link ( to understand
passive, active modes in FTP

My real issue is that there are few firewall setting in the Client
side(the side from which file will be moved to another machine).

>From the above site I found that the FTP protocol at the client side
randomly opens two port one the Command port and Data port.

When I looked at the API,  I found the method

        public void connect(InetAddress
<>  host,
int port, InetAddress
localAddr, int localPort) throws SocketException
<> ,

But using the above method, I can only set the command port, Is there
any way I can set the Data Port used by FTP API.

I don't want the API to randomly select Data port, because this port
might be blocked at the client.

Thanks and Regards

Sathish Gopal

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message