I have a simple code
String staticDir = f.getCanonicalPath() + "/src/main/webapp/static/";
On Windows it will return for me "C:\Temp/src/main/webapp/static/".
How to force Java to use "/" instead of "\"?
I have tried
System.setProperty("file.separator", "/");
String staticDir = f.getCanonicalPath() + "/src/main/webapp/static/";
but it doesn't solved issue for me.
Thank you!
file:///c:/URI instead. stackoverflow.com/a/2466408/2308683/is not the correct way to do it.