You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "anamika ." <aa...@yahoo.com> on 2006/09/11 13:34:00 UTC

[Net] FTP : Connection failure exception

Hello,
   
  I am writing a small code for FTP download. I am using retrieveFile method to download file. 
   
  FileOutputStream fos = new FileOutputStream(LocalFileName);
  try
  {
              ftp.retrieveFile(RemoteFileName,fos);
  }
  catch(Exception e)
  {
              System.out.println(e.getMessage());      
  }
   
  On windows I get exception if connection breaks in between. But I am not getting any exception on Linux. It doesn't recognise connection failure. Program just remains in the state where it is. 
   
  I am using commons.net 1.4.0 and red had linux enterprise 4. 
   
  Please tell me how to handle connection failure on linux. Why it is not giving any exception ? Why this different behaviour on different platforms ?
   
  Thanks and Regards,
  Anamika

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