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){}
}
}

