Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create an empty file (org.apache.commons.net.ftp.FTPClient)

843790Apr 10 2008 — edited Apr 11 2008
Hi,

I'm facing a strange situation using the "org.apache.commons.net.ftp.FTPClient" library.
I'm doing a simple download from a FTP server. I've test my code many times and it always worked, but on production, it creates the file with the correct name but it doesn't write de data inside the new file. It also doesn't return any error.

My code:
	File newFile = new File(localFolder+"\\"+file.getName());

FileOutputStream fos = new FileOutputStream(newFile);			
			
ftpClient.retrieveFile(remoteFolder + "\\" + file.getName(), fos);

fos.close();
Where the object file is my file name and localFolder is where the file is.

Anyone ever faced that problem before?

Thanks,


MJalbert
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 9 2008
Added on Apr 10 2008
2 comments
703 views