Package org.swisspush.gateleen.core.util
Class ResourcesUtils
- java.lang.Object
-
- org.swisspush.gateleen.core.util.ResourcesUtils
-
public class ResourcesUtils extends java.lang.ObjectUtility class providing handy methods to deal with Resources.
- Author:
- https://github.com/mcweba [Marc-Andre Weber]
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringloadResource(java.lang.String resourceName, boolean exceptionWhenNotFound)Loads the resource with the provided name from the classpath.
-
-
-
Method Detail
-
loadResource
public static java.lang.String loadResource(java.lang.String resourceName, boolean exceptionWhenNotFound)Loads the resource with the provided name from the classpath. When param
exceptionWhenNotFoundset to true, aRuntimeExceptionis thrown when the resource cannot be loaded.- Parameters:
resourceName- the name of the resource to loadexceptionWhenNotFound- throw aRuntimeExceptionwhen the resource could not be loaded- Returns:
- The content of the resource or null
- Throws:
java.lang.RuntimeException- whenexceptionWhenNotFoundis set to true and resource cannot be loaded
-
-