Package org.swisspush.gateleen.core.util
Class ResourcesUtils
- java.lang.Object
-
- org.swisspush.gateleen.core.util.ResourcesUtils
-
public class ResourcesUtils extends Object
Utility 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 StringloadResource(String resourceName, boolean exceptionWhenNotFound)Loads the resource with the provided name from the classpath.
-
-
-
Method Detail
-
loadResource
public static String loadResource(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:
RuntimeException- whenexceptionWhenNotFoundis set to true and resource cannot be loaded
-
-