More fooware; download question

I'm trying to write some very simple code to get data from a file amd then do stuff with it. I'm trying to download the file but it's not happening. With forum help I can sucessfully connect now and change to the right directory. When I try and get the file it's not downloading. I've tried retrieve and retrieveStream. Is there something I need to set first? I've also tried just the filename and the complete path.

Is it possible just to read the files contents and store/manipulate it in the program, without actually downloading it?

Thanks in advance.

James

import com.fooware.net.*;

import java.io.FilterReader;

import java.io.Reader;

import java.io.IOException;

import java.io.*;

publicclass Audit

{

publicstaticvoid main(String[] args)

{

try

{

FtpClient ftp =new FtpClient();

ftp.connect("ftp.site.com");

ftp.userName("username");

ftp.password("password");

ftp.dataPort();

//FtpReader in = ftp.list();

ftp.changeWorkingDirectory("/directory");

BufferedReader in =new BufferedReader(ftp.list());

while (in.ready())

System.out.println(in.readLine());

ftp.retrieve("/directory/file");

in.close();

}catch (Exception e){}

}

}

[2266 byte] By [jpifer] at [2007-9-26 1:17:52]
# 1
Can anyone help here?Thanks,James
jpifer at 2007-6-29 0:48:06 > top of Java-index,Archived Forums,Java Programming...
# 2

Yes. You are supposed to read from the reader that retrieve returns you.BufferedReader in = new BufferedReader(

ftp.retrieve("/directory/file"));

while (in.ready())

System.out.println(in.readLine());

in.close();

jsalonen at 2007-6-29 0:48:06 > top of Java-index,Archived Forums,Java Programming...
# 3
Thanks. I'll try it ASAP. James
jpifer at 2007-6-29 0:48:06 > top of Java-index,Archived Forums,Java Programming...