Object
ResourceUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
extractResource
(String absoluteResourcePath, File destination) Extracts resource to the following destination.void
extractResource
(String absoluteResourcePath, Path destination) Extracts resource to the following destination.readResource
(Class<?> clazz, String name) Reads given resource file and returns its content as a stringreadResource
(String absolutePath) Reads given resource file and returns its content as a stringreadResourceAsList
(Class<?> clazz, String name) readResourceAsList
(String absolutePath) readResourceAsStream
(Class<?> clazz, String name) readResourceAsStream
(String absolutePath)
-
Constructor Details
-
ResourceUtils
public ResourceUtils()
-
-
Method Details
-
readResourceAsStream
- See Also:
-
readResourceAsList
- See Also:
-
readResourceAsStream
- See Also:
-
readResourceAsList
- See Also:
-
readResource
Reads given resource file and returns its content as a stringIf you try to read resource from the module you need to "open" that module to xfunction, otherwise Java will throw NPE.
- Parameters:
absolutePath
- absolute path to the resource in form "xxx/xxx/.../resource"
-
readResource
Reads given resource file and returns its content as a stringIf you try to read resource from the module you need to "open" that module to xfunction, otherwise Java will throw NPE.
- Parameters:
clazz
- class in which package resource is locatedname
- resource name
-
extractResource
Extracts resource to the following destination. If file does not exist it will be created. If it exist - overwritten. -
extractResource
Extracts resource to the following destination. If file does not exist it will be created. If it exist - overwritten.
-