Class FileUtils


  • public final class FileUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String readFileContent​(@NotNull java.nio.file.Path path, java.lang.String fileIsNullErrorMessage, java.lang.String fileReadErrorMessage)
      Read file content.
      static java.lang.String readFileToString​(java.nio.file.Path path)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • readFileContent

        public static java.lang.String readFileContent​(@NotNull
                                                       @NotNull java.nio.file.Path path,
                                                       java.lang.String fileIsNullErrorMessage,
                                                       java.lang.String fileReadErrorMessage)
        Read file content.
        Parameters:
        path - to file
        fileIsNullErrorMessage - error message thrown when file is null
        fileReadErrorMessage - error message thrown when can't read file
        Returns:
        file body
      • readFileToString

        public static java.lang.String readFileToString​(java.nio.file.Path path)
                                                 throws java.io.IOException
        Throws:
        java.io.IOException