You want to write a file at a remote URL location?
One option: The File constructor will take a file: based URI as an argument, as long as you have permission to write to that location (if it's on a remote machine you'll need to have a file share setup).
Another Option: Use an FTP library to send the file to the remote location after you have written it locally (requires FTP servers to be running, oh and best to use Apache Commons Net library for this).
There are many other ways to solve this as well, but a key thing is that the remote location must give you permission to write files there.
PS: Oh as a quick admin thing, you can wrap your code in code tags (I've done this for you), makes the code more readable.
subject: Create a file object from avilable in a URL without downloading it