Expected Behavior
Calls to getBankHolidayName(ZonedDateTime, String) shall return.
Current Behavior
When the ephemeris binding calls this core function, an exception is thrown.
Working hypothesis is that getUrl() creates a malformed URL from the string passed, especially when windows paths are passed, starting with a drive letter, e.g. C:\.
Possible Solution
Change
try {
return new URL("file:" + filename);
} catch (MalformedURLException e) {
throw new FileNotFoundException(e.getMessage());
}
to
try {
return filename.toURI().toURL();
} catch (MalformedURLException e) {
throw new FileNotFoundException(e.getMessage());
}
Steps to Reproduce (for Bugs)
Discussions in thread https://community.openhab.org/t/ephemeris-custom-file-not-found/167428/4
0. have openHAB on Windows
- Use ephemeris binding
- create a custom thing
- Apply an ephemeris XML file
- See error message
File is absent: ...
Context
Blocking for using custom ephemeris on windows installations
Your Environment
- Version used: V5.1.3
- Environment name and version openJDK 21
- Operating System and version Windows Server 2019 / Windows 10 / Windows 11
Expected Behavior
Calls to getBankHolidayName(ZonedDateTime, String) shall return.
Current Behavior
When the ephemeris binding calls this core function, an exception is thrown.
Working hypothesis is that getUrl() creates a malformed URL from the string passed, especially when windows paths are passed, starting with a drive letter, e.g.
C:\.Possible Solution
Change
to
Steps to Reproduce (for Bugs)
Discussions in thread https://community.openhab.org/t/ephemeris-custom-file-not-found/167428/4
0. have openHAB on Windows
File is absent: ...Context
Blocking for using custom ephemeris on windows installations
Your Environment