Server doesn't know anything about client and neither is this a good idea to allow server to write files or anything on the client directories as it's an Http Security concerns and it won't allow servers to write viruses, changing properties etc on the user's machines who are visiting their web page.
So, what you can do is, client can send a request to server and server will write file on the client (e.g. browser AND not the directory) with sending back some mime-type. There are few mime-types which now a days, browsers can handle and show to the client from within the browser. Client can then download it or discard it as per his/her own choice to any directory on his/her machine.
Here is a bit of code you can write on server side to achieve what I said above:
OutputStream out = response.getOutputStream();
File file = new File(path_to_a_file);
response.setContentType(file_content_type);
response.setHeader("Content-disposition","attachment; filename="+FILE_NAME);
FileInputStream inputStream = new FileInputStream(FILE);
//Read bytes and write until finished