• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with FTPClient.retrieveFileStream

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,I have a copy function, in which I am using FTPClient.retrieveFileStream to get the InputStream from the file.Here when I give a small size text file it works fine, but I when I test with a real file to be used in my application that has a different extension and and size around 600-700 Kb it just hangs.i am not able to get if its a problem with the buffer size or so?

public void copyFile(String srcPath,String destPath) throws FTPException{
System.out.println("****** copyFile **********");
InputStream is = null;
// verify connection to ftp server

try{

checkConnection();
is = ftpClient.retrieveFileStream(srcPath);
System.out.println(ftpClient.storeUniqueFile(destPath,is));


}catch(IOException e)
{e.printStackTrace();
}

finally{
if (is != null)
{
try{
is.close();}
catch(IOException e)
{e.printStackTrace();
}
}
}
}
 
reply
    Bookmark Topic Watch Topic
  • New Topic