Liam Schnell
Liam Schnell

Reputation: 482

File Not Found Exception apache common

Currently I figured out how to connect to my FTP with apache common to download things (enter IP not the ftp.xxx adress). But now I can an FileNotFound, eventhough it really is there and has everything set to 777

I already saw that apache is adding the "/" by himself so normally It should work, uploading is no problem. Any ideas? I can open the file if I enter it in my URL bar

Upvotes: 0

Views: 340

Answers (1)

MByD
MByD

Reputation: 137322

You should create a file in your system, something like:

File f = new File("path/to/file");
if (f.exists() == false)
{
   f.createNewFile();
}
FileOutputStream fos = new FileOutputStream(f.getAbsoluteFile());
client.retrieveFile("Filenametoretrieve", fos);

Upvotes: 2

Related Questions