< prev index next >
src/java.base/share/classes/java/time/zone/TzdbZoneRulesProvider.java
Print this page
*** 104,117 ****
*
* @throws ZoneRulesException if unable to load
*/
public TzdbZoneRulesProvider() {
try {
! String libDir = System.getProperty("java.home") + File.separator + "lib";
try (DataInputStream dis = new DataInputStream(
new BufferedInputStream(new FileInputStream(
! new File(libDir, "tzdb.dat"))))) {
load(dis);
}
} catch (Exception ex) {
throw new ZoneRulesException("Unable to load TZDB time-zone rules", ex);
}
--- 104,122 ----
*
* @throws ZoneRulesException if unable to load
*/
public TzdbZoneRulesProvider() {
try {
! String pathToRules = System.getProperty("jdk.time.tzdbfile");
! if (pathToRules == null) {
! pathToRules = System.getProperty("java.home") + File.separator + "lib" +
! File.separator + "tzdb.dat";
! }
!
try (DataInputStream dis = new DataInputStream(
new BufferedInputStream(new FileInputStream(
! new File(pathToRules))))) {
load(dis);
}
} catch (Exception ex) {
throw new ZoneRulesException("Unable to load TZDB time-zone rules", ex);
}
< prev index next >