Class FileUtil

java.lang.Object
org.fulib.fx.util.FileUtil

public class FileUtil extends Object
  • Method Details

    • getContent

      @NotNull public static @NotNull String getContent(@NotNull @NotNull File file)
      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 folder
      clazz - The class to get the resource from
      resource - The resource to read
      Returns:
      The file of the given resource