Resources Utils
The ResourcesUtils
class is useful to manage the resources folder to get its resources, both with methods working in the JAR scope and both with method working a runtime outside a JAR
// Invoking a ResourcesUtils method one time
String resourceContent = ResourcesUtils.getResourceContent("my_path_name.resource", MyCallingClass.class);
// Invoking a ResourcesUtils methods multiple time is more efficient instantiating a dedicated object
ResourcesUtils<Class<MyCallingClass>> resourcesUtils = new ResourcesUtils<>(MyCallingClass.class);
String firstResourceContent = resourcesUtils.getResourceContent("my_first_path_name.resource");
String secondResourceContent = resourcesUtils.getResourceContent("my_second_path_name.resource");
Content copied to clipboard
Author
N7ghtm4r3 - Tecknobit
Since
2.2.2
Parameters
<T>
the class from get its classloader to reach the resources folder
Constructors
Link copied to clipboard
Constructor to init the ResourcesUtils class
Properties
Functions
Link copied to clipboard
Method to get the content of a resource file
Link copied to clipboard
Method to a resource file
Link copied to clipboard
Method to get a copy of a resource file
Link copied to clipboard
Method to get a copy of a resource file during the runtime.
Link copied to clipboard
Method to get the stream of a resource file