title: In the following Java code, what is the advantage of using the Apache FileUtils class?
body: <p>I came across the following Java code snippet ( <a href="http://www.studytrails.com/java-io/url-reading-tailing-reverse-reading.jsp" rel="nofollow">source</a> ), that is used to read the <em>last</em> line in a file. It uses two Apache libraries - <a href="https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/input/ReversedLinesFileReader.html" rel="nofollow">ReversedLinesFileReader</a> and <a href="https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html" rel="nofollow">FileUtils</a>.  Here it is :</p>
  
  <pre><code>ReversedLinesFileReader reader = new ReversedLinesFileReader(FileUtils.getFile(file));
  String s = "";
  while ((s = reader.readLine()) != null) {
      System.out.println(s);
  }
  </code></pre>
  
  <p>What I don't understand however, is why do we not simply put in a file path for the argument to ReversedLinesFileReader , and instead we use the FileUtils class. </p>
  
  <p>Why Can't I simply say instead:</p>
  
  <pre><code>File someFile = new File("someFile.txt");
  ReversedLinesFileReader reader = new ReversedLinesFileReader(  someFile ) ;
  </code></pre>
  
  <p>thanks </p>