0

I'm having issues using UNC in a mac to windows situation. I have a Java program and its taking a filepath and creating a File object from a String representation of the filepath. The problem is when the filepath string is passed into the File constructor, one of the forward slashes is removed. I've searched through stackoverflow and I haven't seen this addressed.

ex: "file://path/here/somewhere" becomes "file:/path/here/somewhere"

now keep in mind this is originally a UNC path (ex: \\path\here\somewhere), but I'm trying access it from a Mac. Any help with this frustrating situation would do wonders for my soul.

Joshhw
  • 202
  • 2
  • 14
  • Possible duplicate of [Converting Java file:// URL to File(…) path, platform independent, including UNC paths](http://stackoverflow.com/q/18520972/5221149) – Andreas Aug 04 '16 at 14:57

1 Answers1

0

Try to use java.nio api, it has perfect cross-filesystem tools. Here short example

Vasiliy Pispanen
  • 227
  • 1
  • 12