Class FileUtils


  • public class FileUtils
    extends java.lang.Object
    Files utilities class.
    • Constructor Summary

      Constructors 
      Constructor Description
      FileUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String readTxtFile​(java.lang.String filePath)
      Reads a text file.
      static java.util.Collection<java.lang.String> readTxtFile​(java.lang.String filePath, java.lang.String split)
      Reads a text file and returns it in tokens split by the specified string.
      • Methods inherited from class java.lang.Object

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

      • FileUtils

        public FileUtils()
    • Method Detail

      • readTxtFile

        public static java.lang.String readTxtFile​(java.lang.String filePath)
                                            throws NFEIOException
        Reads a text file.
        Parameters:
        filePath - file path to read.
        Returns:
        An String object with the content of the file.
        Throws:
        NFEIOException - When there is a problem reading the file.
      • readTxtFile

        public static java.util.Collection<java.lang.String> readTxtFile​(java.lang.String filePath,
                                                                         java.lang.String split)
                                                                  throws NFEIOException
        Reads a text file and returns it in tokens split by the specified string. Blank and empty tokens are not included.
        Parameters:
        filePath - file path to read.
        split - string to split the file.
        Returns:
        An array of String objects containing the tokens.
        Throws:
        NFEIOException - When there is a problem reading the file.