Package africa.absa.inception.core.util
Class ResourceUtil
- java.lang.Object
-
- africa.absa.inception.core.util.ResourceUtil
-
public final class ResourceUtil extends Object
The ResourceUtil class is a utility class which provides methods for working with resources.- Author:
- Marcus Portmann
-
-
Constructor Summary
Constructors Constructor Description ResourceUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanclasspathResourceExists(String path)Confirms whether the resource with the specified path exists on the classpath using the context class loader.static byte[]getClasspathResource(String path)Retrieves the resource with the specified path on the classpath using the context class loader.static URLgetClasspathResourceURL(String path)Retrieves the URL for the resource with the specified path on the classpath using the context class loader.static StringgetStringClasspathResource(String path)Retrieves the resource with the specified path on the classpath using the context class loader.
-
-
-
Method Detail
-
classpathResourceExists
public static boolean classpathResourceExists(String path)
Confirms whether the resource with the specified path exists on the classpath using the context class loader.- Parameters:
path- the classpath path for the resource- Returns:
- true if the resource with the specified path exists on the classpath or false otherwise.
-
getClasspathResource
public static byte[] getClasspathResource(String path)
Retrieves the resource with the specified path on the classpath using the context class loader.- Parameters:
path- the path to the resource on the classpath- Returns:
- the resource with the specified path on the classpath using the context class loader
-
getClasspathResourceURL
public static URL getClasspathResourceURL(String path)
Retrieves the URL for the resource with the specified path on the classpath using the context class loader.- Parameters:
path- the path to the resource on the classpath- Returns:
- the URL for the resource with the specified path on the classpath using the context class loader
-
getStringClasspathResource
public static String getStringClasspathResource(String path)
Retrieves the resource with the specified path on the classpath using the context class loader.- Parameters:
path- the path to the resource on the classpath- Returns:
- the resource with the specified path on the classpath using the context class loader
-
-