I am not familiar with Windows shared folders, but here is what I have:
filePath = //server/TEMP/ **(1)**
server = another machine. TEMP = shared folder.
If I open this line with Explorer it goes to
http://server/TEMP/
and I can see list of files and create new.
If I change
filePath = \\server\TEMP\ **(2)**
(slashes replacement) I CAN'T open this directory.
in java code (1.6) I have
File f = new File(filePath);
where filePath can be (1) or (2) - no matters, after creating the File object its .toString()
gives me
\\server\TEMP\ (2)
which CAN'T execute .createNewFile()
with this exception:
java.io.IOException: The network path was not found at
java.io.WinNTFileSystem.createFileExclusively(Native Method) at
java.io.File.createNewFile(Unknown Source)
How to say to java not to convert my slashes? or how to create file without java.io.File?
Thanks, Roman.