commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From van...@webmail.co.za
Subject commons-vfs - Using FTPClient
Date Fri, 29 Sep 2006 14:09:51 GMT
I have the following code and I am attempting to get
a file stored locally, from an FTP site. The file exists
in the parent directory of the FTP site...


//CODE
String filename = "file.zip";

FTPClient f = new FTPClient();
f.connect("ftp.site.com")
f.login("loginname", "password");
System.out.println(f.getReplyString());
f.changeToParentDirectory();

f.type(FTPClient.BINARY_FILE_TYPE);

File file = new File("C:" + File.separator + "temp" + File.separator +
filename);
FileOutputStream fos = new FileOutputStream(file);
f.retrieveFile(filename, fos );
fos.close();

System.out.println(f.getReplyString());
f.logout();
System.out.println(f.getReplyString());
f.disconnect();




This is what the output displays.... message 425 takes about 20
seconds to display... Can anyone help me with this? Thanks!!!!




//OUTPUT
230 Login successful. Have fun.

425 Failed to establish connection.

221 Goodbye.






-------------------------------------------
For super low premiums, click here http://www.webmail.co.za/dd.pwm


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message