Package org.fulib.fx.util
Class FileUtil
java.lang.Object
org.fulib.fx.util.FileUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull StringgetContent(@NotNull File file) Returns the content of the given file as a string.static @NotNull FilegetResourceAsLocalFile(Path basePath, Class<?> clazz, String resource) Returns the file representation of the given resource in the resources folder of the given class.
-
Method Details
-
getContent
Returns the content of the given file as a string.- Parameters:
file- The file to read- Returns:
- The content of the given file as a string or an empty string if the file couldn't be read
-
getResourceAsLocalFile
@NotNull public static @NotNull File getResourceAsLocalFile(Path basePath, Class<?> clazz, String resource) Returns the file representation of the given resource in the resources folder of the given class.- Parameters:
basePath- The base path to the resources folderclazz- The class to get the resource fromresource- The resource to read- Returns:
- The file of the given resource
-