sun.net.ftp.FtpClient;
843811Apr 13 2005 — edited Apr 15 2005i got a simple question,
i used the sun.net.* package to realize a ftp connection, but
the "get" statement takes such a long time, but why, can anyone tell me the reason.
here a part of my code:
public class FTP2 extends FtpClient {
public FTP2(int pflag,String host,String pfad) throws IOException{
int lastSlash = pfad.lastIndexOf('/');
int schalter=0;
String filename = path.substring(lastSlash+1);
String dir = path.substring(0,lastSlash);
FtpClient client = new FtpClient(host);
client.login(user,pass);
client.ascii();
client.cd(dir);
InputStream is;
BufferedInputStream bis;
OutputStream os;
BufferedOutputStream bos;
is= client.get("test.txt");
bis = new BufferedInputStream(is);
os = new FileOutputStream("FTP-Verbindung.txt");
bos = new BufferedOutputStream (os);
and so on....
Thanks for your help!