i have such code
FacesContext context = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
HttpSession httpSession = request.getSession(false);
String resourcePath = request.getSession().getServletContext().getRealPa th("resources");
File src = new File("D:/demo.pdf");
File dst = new File(resourcePath+"\\demo.pdf");
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);

// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
and if server is on local computer its copies demo.pdf from "D" disc to web/resources folder
but how to copy file from D to ftp server s web/resources?
anybody can help me?