prasadmokashi
Programmer
Hi,
I am using Ant 1.6.2 to FTP files from unix server to local windows folder.
following is my code,
public static void getFiles(String ftpServer, String user, String pwd, String fileName){
try{
FTP ftpclient = new FTP();
FileSet fs = new FileSet();
File destination = new File("C:\\Pramo\\Leavers\\");
fs.setDir(destination);
fs.setIncludes("*.txt");
ftpclient.setServer(ftpServer);
ftpclient.setUserid(user);
ftpclient.setPassword(pwd);
ftpclient.setRemotedir(fileName);
FTP.Action ftpa = new FTP.Action();
ftpa.setValue("get");
ftpclient.setAction(ftpa );
ftpclient.setVerbose(true);
ftpclient.setPassive(true);
ftpclient.setProject(project);
ftpclient.addFileset(fs);
ftpclient.execute();
}
catch(Exception ex){
Log.printDebug("ERROR :" + ex.getMessage(),Config.getLogLayer(),Log.DEBUG,"FTPHelper");
}
}
But when I run through this code nothing happens. It doesn't succeed and even doesn't throw any error.
I am sure I am passing correct server, userid,pwd, and filename.
Could anybody please help me.
Thanks,
Prasad
I am using Ant 1.6.2 to FTP files from unix server to local windows folder.
following is my code,
public static void getFiles(String ftpServer, String user, String pwd, String fileName){
try{
FTP ftpclient = new FTP();
FileSet fs = new FileSet();
File destination = new File("C:\\Pramo\\Leavers\\");
fs.setDir(destination);
fs.setIncludes("*.txt");
ftpclient.setServer(ftpServer);
ftpclient.setUserid(user);
ftpclient.setPassword(pwd);
ftpclient.setRemotedir(fileName);
FTP.Action ftpa = new FTP.Action();
ftpa.setValue("get");
ftpclient.setAction(ftpa );
ftpclient.setVerbose(true);
ftpclient.setPassive(true);
ftpclient.setProject(project);
ftpclient.addFileset(fs);
ftpclient.execute();
}
catch(Exception ex){
Log.printDebug("ERROR :" + ex.getMessage(),Config.getLogLayer(),Log.DEBUG,"FTPHelper");
}
}
But when I run through this code nothing happens. It doesn't succeed and even doesn't throw any error.
I am sure I am passing correct server, userid,pwd, and filename.
Could anybody please help me.
Thanks,
Prasad