commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sathish Gopal" <>
Subject Reg: How to set Data port on Commons FTP
Date Fri, 18 Dec 2009 06:05:40 GMT
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



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