src/net/fortuna/ical4j/model/TimeZoneRegistryImpl.java

changeset 3
73bdfa70b04e
parent 0
fb9019fb1bf7
child 5
e0e108e77052
     1.1 --- a/src/net/fortuna/ical4j/model/TimeZoneRegistryImpl.java	Tue Feb 10 19:25:00 2015 +0100
     1.2 +++ b/src/net/fortuna/ical4j/model/TimeZoneRegistryImpl.java	Tue Feb 10 19:38:00 2015 +0100
     1.3 @@ -73,13 +73,19 @@
     1.4      private static final Properties ALIASES = new Properties();
     1.5      static {
     1.6          try {
     1.7 -        	//ALIASES.load(ResourceLoader.getResourceAsStream("net/fortuna/ical4j/model/tz.alias"));
     1.8 -        	ALIASES.load(TimeZoneRegistryImpl.class.getResourceAsStream("tz.alias"));
     1.9 -             }
    1.10 +            ALIASES.load(ResourceLoader.getResourceAsStream("net/fortuna/ical4j/model/tz.alias"));
    1.11 +        }
    1.12          catch (IOException ioe) {
    1.13              LogFactory.getLog(TimeZoneRegistryImpl.class).warn(
    1.14                      "Error loading timezone aliases: " + ioe.getMessage());
    1.15          }
    1.16 +        try {
    1.17 +        	ALIASES.load(ResourceLoader.getResourceAsStream("tz.alias"));
    1.18 +        }
    1.19 +        catch (Exception e) {
    1.20 +        	LogFactory.getLog(TimeZoneRegistryImpl.class).debug(
    1.21 +        			"Error loading custom timezone aliases: " + e.getMessage());
    1.22 +        }
    1.23      }
    1.24  
    1.25      private Map timezones;
    1.26 @@ -180,8 +186,7 @@
    1.27       * Loads an existing VTimeZone from the classpath corresponding to the specified Java timezone.
    1.28       */
    1.29      private VTimeZone loadVTimeZone(final String id) throws IOException, ParserException {
    1.30 -        //final URL resource = ResourceLoader.getResource(resourcePrefix + id + ".ics");
    1.31 -        final URL resource = TimeZoneRegistryImpl.class.getClassLoader().getResource(resourcePrefix + id + ".ics");
    1.32 +        final URL resource = ResourceLoader.getResource(resourcePrefix + id + ".ics");
    1.33          if (resource != null) {
    1.34              final CalendarBuilder builder = new CalendarBuilder();
    1.35              final Calendar calendar = builder.build(resource.openStream());

mercurial