The .toURI()
method allows you to sidestep issues with special characters.
return new File(MyClass.class.getProtectionDomain().getCodeSource().getLocation()
.toURI()).getPath();
The .toURI()
method allows you to sidestep issues with special characters.
return new File(MyClass.class.getProtectionDomain().getCodeSource().getLocation()
.toURI()).getPath();