- java.lang.Object
-
- de.focus_shift.jollyday.core.util.ResourceUtil
-
public final class ResourceUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetCountryDescription(String key)getCountryDescription.static StringgetCountryDescription(Locale locale, String key)Returns the hierarchies description text from the resource bundle.static StringgetHolidayDescription(String key)The description read with the default locale.static StringgetHolidayDescription(Locale locale, String key)The description read with the provided locale.static Optional<URL>getResource(String resourceName)Returns the resource by URL.static Optional<URL>getResource(String resourceName, boolean searchOnlyInJar)Returns the resource by URL.
-
-
-
Field Detail
-
UNDEFINED
public static final String UNDEFINED
Unknown constant will be returned when there is no description configured.- See Also:
- Constant Field Values
-
-
Method Detail
-
getHolidayDescription
public static String getHolidayDescription(String key)
The description read with the default locale.- Parameters:
key- aStringobject.- Returns:
- holiday description using default locale.
-
getHolidayDescription
public static String getHolidayDescription(Locale locale, String key)
The description read with the provided locale.
-
getCountryDescription
public static String getCountryDescription(String key)
getCountryDescription.
- Parameters:
key- aStringobject.- Returns:
- the description
-
getCountryDescription
public static String getCountryDescription(Locale locale, String key)
Returns the hierarchies description text from the resource bundle.- Parameters:
locale- Locale to return the description text for.key- aStringobject.- Returns:
- Description text
-
getResource
public static Optional<URL> getResource(String resourceName)
Returns the resource by URL.- Parameters:
resourceName- the name/path of the resource to load- Returns:
- the URL to the resource
-
getResource
public static Optional<URL> getResource(String resourceName, boolean searchOnlyInJar)
Returns the resource by URL.- Parameters:
resourceName- the name/path of the resource to loadsearchOnlyInJar- if true searches for the given resourceName only in resource with the protocol 'jar' otherwise the protocol is irrelevant- Returns:
- the optional URL to the resource
-
-