Interface FileDescription


public interface FileDescription
Provides a set of useful methods to simplify working with the files.
  • Method Details

    • getFileName

      String getFileName()
      Returns the file name.
    • getCharset

      Charset getCharset()
      Returns the file's charset. Assumed to be UTF-8 if none can be detected.
    • getLineSeparator

      String getLineSeparator()
      Returns the file's preferred line separator by locating the first line separator and assuming "\n" if none are found.
    • getLines

      List<String> getLines()
      Returns the file as a list of lines.
    • formatLinesWithLineNumbers

      String formatLinesWithLineNumbers()
      Return the file as a single string, but with each line prefixed with the line number, starting with 1.
    • from

      static FileDescription from(Path path)