commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sathish Gopal" <Sathish.Go...@ust-global.com>
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 (http://slacksite.com/other/ftp.html) 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
<http://java.sun.com/j2se/1.3/docs/api/java/net/InetAddress.html>  host,
int port, InetAddress
<http://java.sun.com/j2se/1.3/docs/api/java/net/InetAddress.html>
localAddr, int localPort) throws SocketException
<http://java.sun.com/j2se/1.3/docs/api/java/net/SocketException.html> ,
IOException
<http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html> 
 
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

 

 


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