Package org.joda.time.tz
Class ZoneInfoProvider
- java.lang.Object
-
- org.joda.time.tz.ZoneInfoProvider
-
- All Implemented Interfaces:
Provider
public class ZoneInfoProvider extends java.lang.Object implements Provider
ZoneInfoProvider loads compiled data files as generated byZoneInfoCompiler
.ZoneInfoProvider is thread-safe and publicly immutable.
- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description ZoneInfoProvider()
Search the default classloader resource path for compiled data files.ZoneInfoProvider(java.io.File fileDir)
ZoneInfoProvider searches the given directory for compiled data files.ZoneInfoProvider(java.lang.String resourcePath)
ZoneInfoProvider searches the given ClassLoader resource path for compiled data files.ZoneInfoProvider(java.lang.String resourcePath, java.lang.ClassLoader loader)
ZoneInfoProvider searches the given ClassLoader resource path for compiled data files.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.String>
getAvailableIDs()
Gets a list of all the available zone ids.DateTimeZone
getZone(java.lang.String id)
If an error is thrown while loading zone data, the exception is logged to system error and null is returned for this and all future requests.
-
-
-
Constructor Detail
-
ZoneInfoProvider
public ZoneInfoProvider() throws java.io.IOException
Search the default classloader resource path for compiled data files.- Throws:
java.io.IOException
- if directory or map file cannot be read
-
ZoneInfoProvider
public ZoneInfoProvider(java.io.File fileDir) throws java.io.IOException
ZoneInfoProvider searches the given directory for compiled data files.- Throws:
java.io.IOException
- if directory or map file cannot be read
-
ZoneInfoProvider
public ZoneInfoProvider(java.lang.String resourcePath) throws java.io.IOException
ZoneInfoProvider searches the given ClassLoader resource path for compiled data files. Resources are loaded from the ClassLoader that loaded this class.- Throws:
java.io.IOException
- if directory or map file cannot be read
-
ZoneInfoProvider
public ZoneInfoProvider(java.lang.String resourcePath, java.lang.ClassLoader loader) throws java.io.IOException
ZoneInfoProvider searches the given ClassLoader resource path for compiled data files.- Parameters:
loader
- ClassLoader to load compiled data files from. If null, use system ClassLoader.- Throws:
java.io.IOException
- if directory or map file cannot be read
-
-
Method Detail
-
getZone
public DateTimeZone getZone(java.lang.String id)
If an error is thrown while loading zone data, the exception is logged to system error and null is returned for this and all future requests.
-
getAvailableIDs
public java.util.Set<java.lang.String> getAvailableIDs()
Gets a list of all the available zone ids.- Specified by:
getAvailableIDs
in interfaceProvider
- Returns:
- the zone ids
-
-