I want to connect to a remote computer on the network that is NOT currently Drive mapped to my local computer.
I then want to copy a file from my local computer to the remote computer.
The code I have been trying to use is this:
URI fileURI1 = new URI("file:////USERID:PASSWORD@REMOTEHOSTNAME/SHARENAME/myfile.txt");
File fileTemp = new File(fileURI1);
OutputStream out = new FileOutputStream(fileTemp);
I get the following exception
java.io.FileNotFoundException: \\USERID:PASSWORD@REMOTEHOSTNAME\SHARENAME\myfile.txt (The network path was not found)
WHat am I doing wrong?