commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JJ Fu <jianjun...@yahoo.com>
Subject help with commons.net ftp
Date Fri, 15 Sep 2006 22:09:01 GMT
I tried to use the commons.net ftp package and here is
the code:

      FTPClient ftp = new FTPClient();
      ftp.connect( server );
      ftp.login( username, password );
      application.log("Connected to " + server + ".");
      application.log(ftp.getReplyString());

      ftp.enterLocalPassiveMode();
      ftp.setFileType(FTPClient.BINARY_FILE_TYPE);

      // List the files in the directory
      ftp.changeWorkingDirectory(folder);
      application.log("changed dir to " + folder);
     
      String [] names = ftp.listNames();   ------down
to this line 
everything is fine .

      FTPFile [] files = ftp.listFiles();    
-----this line cause exception
       ............

   The last line throws this message: exception
occured 
java.net.ConnectException: Connection refused:
connect.
Connection is already established. why it say refused?
any idea ?


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message