Good morning All,
I needed a scheduler which could upload some xml files from remot server to my server location through FTP but
when I restart the server it upload the files from remote server to my server location but when I put xml files in between
(when server running) at remote server then it does not upload the files to my server.
Can any one tell me the reason/solution.
import java.util.Timer;
import java.util.TimerTask;
import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServlet;
import com.broadvision.action.xmlrequest.XMLRequestUtil;
import corp.broadvision.org.util.BVLog;
public class SchedularServlet extends HttpServlet {
public void init(ServletConfig conf) {
try {
int initialDelay = Integer.parseInt(conf.getInitParameter("initialDelay")); // start after 30 seconds 30000
int period = Integer.parseInt(conf.getInitParameter("period")); // repeat every 5 minutes 300000300000
Timer timer = new Timer();
TimerTask task = new TimerTask() {
public void run() {
boolean rssobj=new com.broadvision.action.xmlrequest.XMLRequestUtil().getXMLRequestFiles2DB();
if(!rssobj){
BVLog.error(20,"Either no file at RIL server location or getXMLRequestFiles2DB return false:"+rssobj);
}
}
};
timer.scheduleAtFixedRate(task, initialDelay, period);
}
catch (Exception e) {
BVLog.error(20,"Exception inside SchedularServlet class:::"+e.toString());
e.printStackTrace();
}
}
}
Thanks in advance.
Regards,
Durgesh Pratap Rajbhar
